{ "cells": [ { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Processing file: E:\\training_dir\\realistic-sample-prompts.txt\n",
       "
\n" ], "text/plain": [ "Processing file: E:\\training_dir\\realistic-sample-prompts.txt\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n",
       "┃ Prompt Type  Prompt                                                                               Token Count ┃\n",
       "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n",
       "│ Positive    │ score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo,   │          60 │\n",
       "│             │ female anthro kindred, mask, presenting, white pillow, bedroom, looking at viewer,  │             │\n",
       "│             │ detailed background, amazing_background, scenery porn, realistic, photo             │             │\n",
       "│ Negative    │ low quality, worst quality, blurred background, blurry, simple background           │          13 │\n",
       "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n",
       "
\n" ], "text/plain": [ "┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n", "│ \u001b[32mPositive\u001b[0m │ score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, │ 60 │\n", "│ │ female anthro kindred, mask, presenting, white pillow, bedroom, looking at viewer, │ │\n", "│ │ detailed background, amazing_background, scenery porn, realistic, photo │ │\n", "│ \u001b[31mNegative\u001b[0m │ low quality, worst quality, blurred background, blurry, simple background │ 13 │\n", "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n",
       "┃ Prompt Type  Prompt                                                                               Token Count ┃\n",
       "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n",
       "│ Positive    │ score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo,   │          70 │\n",
       "│             │ anthro female wolf, sexy pose, standing, gray fur, brown fur, canine pussy, black   │             │\n",
       "│             │ nose, blue eyes, pink areola, pink nipples, detailed background,                    │             │\n",
       "│             │ amazing_background, realistic, photo                                                │             │\n",
       "│ Negative    │ low quality, worst quality, blurred background, blurry, simple background           │          13 │\n",
       "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n",
       "
\n" ], "text/plain": [ "┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n", "│ \u001b[32mPositive\u001b[0m │ score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, │ 70 │\n", "│ │ anthro female wolf, sexy pose, standing, gray fur, brown fur, canine pussy, black │ │\n", "│ │ nose, blue eyes, pink areola, pink nipples, detailed background, │ │\n", "│ │ amazing_background, realistic, photo │ │\n", "│ \u001b[31mNegative\u001b[0m │ low quality, worst quality, blurred background, blurry, simple background │ 13 │\n", "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n",
       "┃ Prompt Type  Prompt                                                                               Token Count ┃\n",
       "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n",
       "│ Positive    │ score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo,   │          73 │\n",
       "│             │ anthro male fox, glowing yellow eyes, night, crescent moon, gold bracers and        │             │\n",
       "│             │ necklace, loincloth, canine genitalia, knot, amazing_background, scenery porn,      │             │\n",
       "│             │ white marble ruins, realistic, photo                                                │             │\n",
       "│ Negative    │ low quality, worst quality, blurred background, blurry, simple background           │          13 │\n",
       "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n",
       "
\n" ], "text/plain": [ "┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n", "│ \u001b[32mPositive\u001b[0m │ score_9, score_8_up, score_7_up, score_6_up, rating_explicit, source_furry, solo, │ 73 │\n", "│ │ anthro male fox, glowing yellow eyes, night, crescent moon, gold bracers and │ │\n", "│ │ necklace, loincloth, canine genitalia, knot, amazing_background, scenery porn, │ │\n", "│ │ white marble ruins, realistic, photo │ │\n", "│ \u001b[31mNegative\u001b[0m │ low quality, worst quality, blurred background, blurry, simple background │ 13 │\n", "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n",
       "┃ Prompt Type  Prompt                                                                               Token Count ┃\n",
       "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n",
       "│ Positive    │ score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, solo,       │          74 │\n",
       "│             │ full-length portrait, anthro female red panda, detailed background,                 │             │\n",
       "│             │ amazing_background, pussy, scenery porn, photo, realistic, looking at viewer, on    │             │\n",
       "│             │ back, sexy pose, humanoid hands, claws, pink areola, pink nipples                   │             │\n",
       "│ Negative    │ low quality, worst quality, blurred background, blurry, simple background           │          13 │\n",
       "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n",
       "
\n" ], "text/plain": [ "┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n", "│ \u001b[32mPositive\u001b[0m │ score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, solo, │ 74 │\n", "│ │ full-length portrait, anthro female red panda, detailed background, │ │\n", "│ │ amazing_background, pussy, scenery porn, photo, realistic, looking at viewer, on │ │\n", "│ │ back, sexy pose, humanoid hands, claws, pink areola, pink nipples │ │\n", "│ \u001b[31mNegative\u001b[0m │ low quality, worst quality, blurred background, blurry, simple background │ 13 │\n", "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n",
       "┃ Prompt Type  Prompt                                                                               Token Count ┃\n",
       "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n",
       "│ Positive    │ score_9, score_8_up, score_7_up, rating_explicit, source_furry, solo, full-length   │          69 │\n",
       "│             │ portrait, anthro female snow leopard, pussy, pink nipples, pink areola, detailed    │             │\n",
       "│             │ background, amazing_background, scenery porn, snowy mountain peak, on back, sexy    │             │\n",
       "│             │ pose, looking at viewer, realistic, photo                                           │             │\n",
       "│ Negative    │ low quality, worst quality, blurred background, blurry, simple background           │          13 │\n",
       "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n",
       "
\n" ], "text/plain": [ "┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n", "│ \u001b[32mPositive\u001b[0m │ score_9, score_8_up, score_7_up, rating_explicit, source_furry, solo, full-length │ 69 │\n", "│ │ portrait, anthro female snow leopard, pussy, pink nipples, pink areola, detailed │ │\n", "│ │ background, amazing_background, scenery porn, snowy mountain peak, on back, sexy │ │\n", "│ │ pose, looking at viewer, realistic, photo │ │\n", "│ \u001b[31mNegative\u001b[0m │ low quality, worst quality, blurred background, blurry, simple background │ 13 │\n", "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n",
       "┃ Prompt Type  Prompt                                                                               Token Count ┃\n",
       "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n",
       "│ Positive    │ score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, portrait,   │          71 │\n",
       "│             │ an anthro male wolf, black nose, (white fur:1.2), monotone fur, green eyes, purple  │             │\n",
       "│             │ wizard hat, purple wizard robe, detailed background, amazing_background, forest,    │             │\n",
       "│             │ realistic, photo                                                                    │             │\n",
       "│ Negative    │ low quality, worst quality, blurred background, blurry, simple background           │          13 │\n",
       "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n",
       "
\n" ], "text/plain": [ "┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓\n", "┃\u001b[1m \u001b[0m\u001b[1mPrompt Type\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mPrompt \u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1mToken Count\u001b[0m\u001b[1m \u001b[0m┃\n", "┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩\n", "│ \u001b[32mPositive\u001b[0m │ score_9, score_8_up, score_7_up, score_6_up, rating_safe, source_furry, portrait, │ 71 │\n", "│ │ an anthro male wolf, black nose, (white fur:1.2), monotone fur, green eyes, purple │ │\n", "│ │ wizard hat, purple wizard robe, detailed background, amazing_background, forest, │ │\n", "│ │ realistic, photo │ │\n", "│ \u001b[31mNegative\u001b[0m │ low quality, worst quality, blurred background, blurry, simple background │ 13 │\n", "└─────────────┴─────────────────────────────────────────────────────────────────────────────────────┴─────────────┘\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Total number of prompts in realistic-sample-prompts.txt: 6\n",
       "
\n" ], "text/plain": [ "\u001b[1mTotal number of prompts in realistic-sample-prompts.txt: \u001b[0m\u001b[1;36m6\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import os\n", "import tiktoken\n", "from rich.console import Console\n", "from rich.table import Table\n", "\n", "\n", "def count_tokens(text):\n", " enc = tiktoken.get_encoding(\"cl100k_base\")\n", " tokens = enc.encode(text)\n", " return len(tokens)\n", "\n", "count_tokens(\"canine genitalia, knot\")\n", "\n", "console = Console()\n", "\n", "for file in os.listdir(\"E:\\\\training_dir\"):\n", " if file.endswith(\"-sample-prompts.txt\"):\n", " file_path = os.path.join(\"E:\\\\training_dir\", file)\n", " console.print(f\"Processing file: {file_path}\")\n", "\n", " prompt_count = 0\n", " with open(file_path, \"r\") as f:\n", " lines = f.readlines()\n", "\n", " for line in lines:\n", " if line.startswith(\"#\"):\n", " continue\n", " parts = line.split(\"--n\")\n", " positive_prompt = parts[0].strip()\n", " negative_prompt = parts[1].strip().split(\" --\")[0]\n", "\n", " positive_token_count = count_tokens(positive_prompt)\n", " negative_token_count = count_tokens(negative_prompt)\n", "\n", " table = Table()\n", " table.add_column(\"Prompt Type\", justify=\"left\")\n", " table.add_column(\"Prompt\", justify=\"left\")\n", " table.add_column(\"Token Count\", justify=\"right\")\n", " table.add_row(\"[green]Positive[/green]\", positive_prompt, str(positive_token_count))\n", " table.add_row(\"[red]Negative[/red]\", negative_prompt, str(negative_token_count))\n", " console.print(table)\n", "\n", " if positive_token_count > 77:\n", " console.print(\n", " \"[bold red]Warning: Positive prompt token count exceeds 75.[/bold red]\"\n", " )\n", " prompt_count += 1\n", "\n", " console.print(f\"[bold]Total number of prompts in {file}: {prompt_count}[/bold]\")" ] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" } }, "nbformat": 4, "nbformat_minor": 2 }