Dataset: FLUX.2-dev + app-aligned prompts with multi-animal/place combos
Browse filesimage_generator.py:
- Extract build_subject(animals, places) β "A cute {animals} {places}"
shared core; build_prompt now = build_subject + ", " + NUMZOO_STYLE
- Add _join() helper for the 1β3 phrase joining
scripts/generate_dataset.py:
- Switch model to FLUX.2-dev (via fal-ai provider, HF Pro credits)
- Rebuild prompts programmatically from the app's exact ANIMAL_MAP /
PLACE_MAP using the shared build_subject β captions are byte-identical
in structure to live app prompts, just with a rich scene-detail clause
- 54 curated scenes: all 12 animals solo, all 10 places, plus deliberate
2β3 animal and 2β3 place combinations mirroring multi-emoji selections
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- image_generator.py +17 -20
- scripts/generate_dataset.py +111 -205
image_generator.py
CHANGED
|
@@ -174,30 +174,27 @@ NUMZOO_STYLE = (
|
|
| 174 |
# Prompt builder
|
| 175 |
# ---------------------------------------------------------------------------
|
| 176 |
|
| 177 |
-
def
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
animal_list = animals[:3] if animals else [random.choice(list(ANIMAL_MAP))]
|
| 180 |
place_list = places[:3] if places else [random.choice(list(PLACE_MAP))]
|
|
|
|
|
|
|
|
|
|
| 181 |
|
| 182 |
-
# Build animal text: "puppy", "puppy and bunny", "puppy, bunny and kitten"
|
| 183 |
-
animal_names = [ANIMAL_MAP.get(a, "bunny") for a in animal_list]
|
| 184 |
-
if len(animal_names) == 1:
|
| 185 |
-
animal_text = animal_names[0]
|
| 186 |
-
elif len(animal_names) == 2:
|
| 187 |
-
animal_text = f"{animal_names[0]} and {animal_names[1]}"
|
| 188 |
-
else:
|
| 189 |
-
animal_text = f"{animal_names[0]}, {animal_names[1]} and {animal_names[2]}"
|
| 190 |
-
|
| 191 |
-
# Build place text: "in a garden", "in a garden and under a rainbow", ...
|
| 192 |
-
place_texts = [PLACE_MAP.get(p, "in a magical garden") for p in place_list]
|
| 193 |
-
if len(place_texts) == 1:
|
| 194 |
-
place_text = place_texts[0]
|
| 195 |
-
elif len(place_texts) == 2:
|
| 196 |
-
place_text = f"{place_texts[0]} and {place_texts[1]}"
|
| 197 |
-
else:
|
| 198 |
-
place_text = f"{place_texts[0]}, {place_texts[1]} and {place_texts[2]}"
|
| 199 |
|
| 200 |
-
|
|
|
|
| 201 |
|
| 202 |
# ---------------------------------------------------------------------------
|
| 203 |
# Pipeline loader (cached globally β survives between ZeroGPU calls)
|
|
|
|
| 174 |
# Prompt builder
|
| 175 |
# ---------------------------------------------------------------------------
|
| 176 |
|
| 177 |
+
def _join(parts: list[str]) -> str:
|
| 178 |
+
"""Join 1β3 phrases: 'a', 'a and b', 'a, b and c'."""
|
| 179 |
+
if len(parts) == 1:
|
| 180 |
+
return parts[0]
|
| 181 |
+
if len(parts) == 2:
|
| 182 |
+
return f"{parts[0]} and {parts[1]}"
|
| 183 |
+
return f"{parts[0]}, {parts[1]} and {parts[2]}"
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
def build_subject(animals: list[str], places: list[str]) -> str:
|
| 187 |
+
"""The 'A cute {animals} {places}' core β SHARED with scripts/generate_dataset.py
|
| 188 |
+
so training captions and live prompts use the exact same structure & vocabulary."""
|
| 189 |
animal_list = animals[:3] if animals else [random.choice(list(ANIMAL_MAP))]
|
| 190 |
place_list = places[:3] if places else [random.choice(list(PLACE_MAP))]
|
| 191 |
+
animal_text = _join([ANIMAL_MAP.get(a, "bunny") for a in animal_list])
|
| 192 |
+
place_text = _join([PLACE_MAP.get(p, "in a magical garden") for p in place_list])
|
| 193 |
+
return f"A cute {animal_text} {place_text}"
|
| 194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
+
def build_prompt(animals: list[str], places: list[str]) -> str:
|
| 197 |
+
return f"{build_subject(animals, places)}, {NUMZOO_STYLE}"
|
| 198 |
|
| 199 |
# ---------------------------------------------------------------------------
|
| 200 |
# Pipeline loader (cached globally β survives between ZeroGPU calls)
|
scripts/generate_dataset.py
CHANGED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
"""
|
| 2 |
NumZoo training dataset generator.
|
| 3 |
|
| 4 |
-
Generates
|
| 5 |
-
HuggingFace Inference API (fal-ai provider
|
| 6 |
|
| 7 |
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
-
-
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
Output: training/image_001.jpg + training/image_001.txt (caption)
|
| 13 |
|
| 14 |
Requirements:
|
| 15 |
-
pip install huggingface_hub pillow python-dotenv
|
| 16 |
|
| 17 |
Setup (HF Pro β just your existing token):
|
| 18 |
-
1.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
With HF Pro your token already has credits on fal-ai, replicate, together etc.
|
| 24 |
-
No separate provider account needed.
|
| 25 |
|
| 26 |
Usage:
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
"""
|
| 32 |
|
| 33 |
import os
|
|
@@ -43,206 +43,112 @@ try:
|
|
| 43 |
except ImportError:
|
| 44 |
pass # dotenv optional β can also export GEMINI_API_KEY manually
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
#
|
| 48 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 49 |
-
from image_generator import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
# ---------------------------------------------------------------------------
|
| 52 |
-
#
|
| 53 |
-
#
|
|
|
|
|
|
|
|
|
|
| 54 |
# ---------------------------------------------------------------------------
|
| 55 |
|
| 56 |
-
|
| 57 |
-
# ββ
|
| 58 |
-
("
|
| 59 |
-
|
| 60 |
-
("
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
("
|
| 64 |
-
|
| 65 |
-
("
|
| 66 |
-
|
| 67 |
-
("
|
| 68 |
-
|
| 69 |
-
("
|
| 70 |
-
|
| 71 |
-
("
|
| 72 |
-
|
| 73 |
-
("
|
| 74 |
-
|
| 75 |
-
("
|
| 76 |
-
|
| 77 |
-
("
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
("
|
| 84 |
-
|
| 85 |
-
("
|
| 86 |
-
|
| 87 |
-
("
|
| 88 |
-
|
| 89 |
-
("
|
| 90 |
-
|
| 91 |
-
("
|
| 92 |
-
|
| 93 |
-
("
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
("
|
| 98 |
-
|
| 99 |
-
("
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
("
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
("
|
| 108 |
-
|
| 109 |
-
("
|
| 110 |
-
|
| 111 |
-
("
|
| 112 |
-
|
| 113 |
-
("
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
("
|
| 118 |
-
|
| 119 |
-
("
|
| 120 |
-
f"warm firelight, stars through the tree canopy, {STYLE}"),
|
| 121 |
-
("forest_night_10", f"a kitten catching fireflies in a jar at the edge of a glowing forest at dusk, "
|
| 122 |
-
f"silhouette trees, warm golden light, {STYLE}"),
|
| 123 |
-
|
| 124 |
-
# ββ 4. Treehouse ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 125 |
-
("treehouse_01", f"a bunny inside a cozy treehouse at sunset, rope bridge entrance, "
|
| 126 |
-
f"flower window box, warm light glowing inside, {STYLE}"),
|
| 127 |
-
("treehouse_02", f"a kitten at the door of a treehouse with a welcome sign, "
|
| 128 |
-
f"string lights along the railing, forest view at golden hour, {STYLE}"),
|
| 129 |
-
("treehouse_03", f"a baby bear and a hedgehog playing board games on the treehouse porch, "
|
| 130 |
-
f"paper lanterns, leafy canopy above, {STYLE}"),
|
| 131 |
-
("treehouse_04", f"a baby fox gazing at the stars through a treehouse telescope at night, "
|
| 132 |
-
f"spiral staircase, crescent moon, {STYLE}"),
|
| 133 |
-
("treehouse_05", f"an owl's cozy treehouse library with tiny glowing books and a reading nook, "
|
| 134 |
-
f"ivy covered walls, daytime, {STYLE}"),
|
| 135 |
-
("treehouse_06", f"a baby bear watering flower boxes on a treehouse balcony, "
|
| 136 |
-
f"bees and butterflies, golden afternoon light, leafy forest below, {STYLE}"),
|
| 137 |
-
("treehouse_07", f"a hedgehog and a squirrel stringing fairy lights around a treehouse at dusk, "
|
| 138 |
-
f"warm glow, birds watching from nearby branches, {STYLE}"),
|
| 139 |
-
("treehouse_08", f"a baby fox sliding down a spiral slide from a treehouse into a pile of leaves, "
|
| 140 |
-
f"autumn forest, rope ladder, golden light, {STYLE}"),
|
| 141 |
-
("treehouse_09", f"a baby deer reading a glowing map inside a treehouse at night, "
|
| 142 |
-
f"star-shaped windows, moonlight, cozy lanterns, {STYLE}"),
|
| 143 |
-
("treehouse_10", f"a raccoon and a bunny cooking soup in a tiny treehouse kitchen, "
|
| 144 |
-
f"steam rising, herbs hanging, sunlight through small windows, {STYLE}"),
|
| 145 |
-
|
| 146 |
-
# ββ 5. Garden / meadow β day ββββββββββββββββββββββββββββββββββββββββββββ
|
| 147 |
-
("garden_01", f"a bunny watering oversized tulips in a magical garden, "
|
| 148 |
-
f"pastel blue watering can, butterflies, soft morning light, {STYLE}"),
|
| 149 |
-
("garden_02", f"a kitten napping in a flower hammock in a sunny garden, "
|
| 150 |
-
f"roses and lavender around, bees buzzing, {STYLE}"),
|
| 151 |
-
("garden_03", f"a baby bear picking giant strawberries in a garden, "
|
| 152 |
-
f"ladybugs on leaves, warm afternoon sun, picket fence, {STYLE}"),
|
| 153 |
-
("garden_04", f"a hedgehog rolling through a field of sunflowers, "
|
| 154 |
-
f"pastel sky, birds above, soft breeze, {STYLE}"),
|
| 155 |
-
("garden_05", f"a baby fox blowing dandelion seeds in a meadow, "
|
| 156 |
-
f"seeds glowing like stars, cherry trees in background, {STYLE}"),
|
| 157 |
-
("garden_06", f"a baby deer in a rain boots splashing in a puddle in a garden after rain, "
|
| 158 |
-
f"rainbow in the sky, wet flowers, {STYLE}"),
|
| 159 |
-
("garden_07", f"a raccoon painting a garden fence with rainbow stripes, "
|
| 160 |
-
f"paint buckets, butterflies landing on fresh paint, {STYLE}"),
|
| 161 |
-
("garden_08", f"a baby penguin planting seeds in a tiny garden plot, "
|
| 162 |
-
f"little labeled plant markers, pastel gloves and apron, {STYLE}"),
|
| 163 |
-
("garden_09", f"a squirrel collecting colorful autumn leaves in a basket in a golden meadow, "
|
| 164 |
-
f"maple trees, soft warm light, {STYLE}"),
|
| 165 |
-
("garden_10", f"a bunny and kitten flying a star-shaped kite in an open meadow, "
|
| 166 |
-
f"puffy clouds, wildflowers below, {STYLE}"),
|
| 167 |
-
|
| 168 |
-
# ββ 6. Beach / waterfront βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 169 |
-
("beach_01", f"a bunny building a sand castle on a pastel beach at sunset, "
|
| 170 |
-
f"sea shells, gentle waves, pink and orange sky, {STYLE}"),
|
| 171 |
-
("beach_02", f"a kitten surfing a tiny wave on a pastel board, "
|
| 172 |
-
f"tropical beach, palm trees, clear turquoise water, {STYLE}"),
|
| 173 |
-
("beach_03", f"a baby bear making friends with a crab on the beach, "
|
| 174 |
-
f"rock pools with anemones, soft summer light, {STYLE}"),
|
| 175 |
-
("beach_04", f"a baby fox asleep in a hammock strung between two palm trees on a beach, "
|
| 176 |
-
f"coconuts, ocean at dusk, {STYLE}"),
|
| 177 |
-
("beach_05", f"a baby penguin waddling along a sandy beach collecting glowing starfish at night, "
|
| 178 |
-
f"bioluminescent waves, crescent moon, {STYLE}"),
|
| 179 |
-
("beach_06", f"a bunny and a hedgehog sharing a watermelon slice on a colorful beach towel, "
|
| 180 |
-
f"sunny beach, parasol, gentle waves, {STYLE}"),
|
| 181 |
-
("beach_07", f"a baby fox building a sand boat on the beach, "
|
| 182 |
-
f"pebble sail, seagulls, golden sunset, {STYLE}"),
|
| 183 |
-
("beach_08", f"a baby bear snorkeling in a clear lagoon, colorful fish and coral below, "
|
| 184 |
-
f"tropical beach, bright midday light, {STYLE}"),
|
| 185 |
-
("beach_09", f"a kitten watching the sunset from a dock over calm ocean water, "
|
| 186 |
-
f"orange and pink sky, lantern beside, soft waves, {STYLE}"),
|
| 187 |
-
("beach_10", f"a baby deer and a squirrel collecting shells in tide pools at low tide, "
|
| 188 |
-
f"pastel sunset, starfish, {STYLE}"),
|
| 189 |
-
|
| 190 |
-
# ββ 7. Snowy winter ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 191 |
-
("snow_01", f"a bunny building a snowman in a snowy forest clearing, "
|
| 192 |
-
f"carrot nose, scarf, snowflakes falling, soft pink sky, {STYLE}"),
|
| 193 |
-
("snow_02", f"a kitten ice skating on a frozen pond in a winter forest, "
|
| 194 |
-
f"snowflakes, pine trees with snow caps, fairy lights on branches, {STYLE}"),
|
| 195 |
-
("snow_03", f"a baby bear sledding down a snowy hill at night, "
|
| 196 |
-
f"moonlight, sparkling snow, cozy village lights below, {STYLE}"),
|
| 197 |
-
("snow_04", f"a hedgehog warming up by a bonfire in the snow, "
|
| 198 |
-
f"hot chocolate in tiny paws, snowflakes floating, pine forest, {STYLE}"),
|
| 199 |
-
("snow_05", f"a baby fox wrapped in a giant scarf making snow angels in a winter field, "
|
| 200 |
-
f"snowflakes, soft blue and white tones, {STYLE}"),
|
| 201 |
-
("snow_06", f"an owl delivering a tiny letter through falling snow to a cabin, "
|
| 202 |
-
f"warm window glow, snow-covered trees, {STYLE}"),
|
| 203 |
-
("snow_07", f"a baby deer with snowflakes on its nose in a quiet snowy forest, "
|
| 204 |
-
f"bare tree branches with icicles, soft grey-blue light, {STYLE}"),
|
| 205 |
-
("snow_08", f"a raccoon and a squirrel having a snowball fight in a park, "
|
| 206 |
-
f"snow-covered benches, winter lanterns, {STYLE}"),
|
| 207 |
-
("snow_09", f"a baby penguin sliding down an icy path to the frozen ocean, "
|
| 208 |
-
f"auroras in the sky, soft blue and green glow, {STYLE}"),
|
| 209 |
-
("snow_10", f"a bunny and kitten sharing a pastel umbrella in gently falling snow, "
|
| 210 |
-
f"fairy lights on trees, warm glow from a cafΓ© window, {STYLE}"),
|
| 211 |
-
|
| 212 |
-
# ββ 8. Autumn / rainy day ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 213 |
-
("autumn_01", f"a bunny jumping in a pile of colorful autumn leaves in a park, "
|
| 214 |
-
f"orange and red maples, soft afternoon sun, {STYLE}"),
|
| 215 |
-
("autumn_02", f"a kitten at a rainy window with a cup of tea, "
|
| 216 |
-
f"raindrops on glass, cozy sweater, autumn forest visible outside, {STYLE}"),
|
| 217 |
-
("autumn_03", f"a baby bear in a pumpkin patch at golden hour, "
|
| 218 |
-
f"scarecrow, autumn leaves drifting, {STYLE}"),
|
| 219 |
-
("autumn_04", f"a hedgehog foraging mushrooms in an autumn forest, "
|
| 220 |
-
f"golden light through orange leaves, red berries, {STYLE}"),
|
| 221 |
-
("autumn_05", f"a baby fox jumping through autumn leaves in a red-orange forest, "
|
| 222 |
-
f"bokeh light, warm amber tones, {STYLE}"),
|
| 223 |
-
("autumn_06", f"an owl in a cozy raincoat standing under a colorful mushroom in the rain, "
|
| 224 |
-
f"puddles reflecting fairy lights, {STYLE}"),
|
| 225 |
-
("autumn_07", f"a baby deer watching the first autumn rain from under a giant leaf, "
|
| 226 |
-
f"golden forest background, raindrops sparkle, {STYLE}"),
|
| 227 |
-
("autumn_08", f"a raccoon selling hot apple cider from a tiny wooden cart in an autumn market, "
|
| 228 |
-
f"string lights, orange and red leaves, {STYLE}"),
|
| 229 |
-
("autumn_09", f"a squirrel cozy in a hollow tree watching autumn rain, "
|
| 230 |
-
f"acorn collection visible inside, warm golden glow, {STYLE}"),
|
| 231 |
-
("autumn_10", f"a bunny and a baby fox under a giant colorful umbrella in a rainy autumn street, "
|
| 232 |
-
f"cafΓ© lights, reflections in puddles, {STYLE}"),
|
| 233 |
]
|
| 234 |
|
| 235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
|
| 237 |
# ---------------------------------------------------------------------------
|
| 238 |
-
# Generator using FLUX.
|
| 239 |
# ---------------------------------------------------------------------------
|
| 240 |
|
| 241 |
# Provider β model routing:
|
| 242 |
-
# fal-ai β FLUX.
|
| 243 |
-
# hf-inference β FLUX.1-schnell
|
| 244 |
PROVIDERS = {
|
| 245 |
-
"fal-ai": "black-forest-labs/FLUX.
|
| 246 |
"hf-inference": "black-forest-labs/FLUX.1-schnell",
|
| 247 |
}
|
| 248 |
|
|
|
|
| 1 |
"""
|
| 2 |
NumZoo training dataset generator.
|
| 3 |
|
| 4 |
+
Generates LoRA training images matching the NumZoo aesthetic using FLUX.2-dev
|
| 5 |
+
via the HuggingFace Inference API (fal-ai provider, billed to your HF Pro credits).
|
| 6 |
|
| 7 |
+
Alignment with the live app is guaranteed by construction:
|
| 8 |
+
- The "A cute {animals} {places}" prefix is built with image_generator.build_subject
|
| 9 |
+
(the SAME function the app uses), from the app's exact ANIMAL_MAP / PLACE_MAP.
|
| 10 |
+
- The NUMZOO_STYLE suffix is imported from image_generator.
|
| 11 |
+
- Scenes deliberately mix 1β3 animals and 1β3 places, exactly like the app does
|
| 12 |
+
when the player selects multiple emojis.
|
| 13 |
+
So every caption looks like a real app prompt, plus a rich scene detail clause.
|
| 14 |
|
| 15 |
Output: training/image_001.jpg + training/image_001.txt (caption)
|
| 16 |
|
| 17 |
Requirements:
|
| 18 |
+
~/miniforge3/bin/pip install huggingface_hub pillow python-dotenv
|
| 19 |
|
| 20 |
Setup (HF Pro β just your existing token):
|
| 21 |
+
1. Accept the FLUX.2-dev license: https://huggingface.co/black-forest-labs/FLUX.2-dev
|
| 22 |
+
2. Get an HF token (fine-grained, "Make calls to Inference Providers" permission)
|
| 23 |
+
https://huggingface.co/settings/tokens
|
| 24 |
+
3. Add to .env: HF_TOKEN=hf_...
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
Usage:
|
| 27 |
+
~/miniforge3/bin/python3 scripts/generate_dataset.py # all scenes
|
| 28 |
+
~/miniforge3/bin/python3 scripts/generate_dataset.py --count 5 # first 5 (test run)
|
| 29 |
+
~/miniforge3/bin/python3 scripts/generate_dataset.py --start 20 # resume from #20
|
| 30 |
+
~/miniforge3/bin/python3 scripts/generate_dataset.py --dry-run # preview prompts
|
| 31 |
"""
|
| 32 |
|
| 33 |
import os
|
|
|
|
| 43 |
except ImportError:
|
| 44 |
pass # dotenv optional β can also export GEMINI_API_KEY manually
|
| 45 |
|
| 46 |
+
# Reuse the app's exact prompt builder + vocabulary so training captions and live
|
| 47 |
+
# prompts share the same structure ("A cute {animals} {places}") and emoji mappings.
|
| 48 |
sys.path.insert(0, str(Path(__file__).parent.parent))
|
| 49 |
+
from image_generator import ( # noqa: E402
|
| 50 |
+
build_subject,
|
| 51 |
+
NUMZOO_STYLE as STYLE,
|
| 52 |
+
ANIMAL_MAP,
|
| 53 |
+
PLACE_MAP,
|
| 54 |
+
)
|
| 55 |
|
| 56 |
# ---------------------------------------------------------------------------
|
| 57 |
+
# Scenes: (animal emojis, place emojis, scene-detail clause)
|
| 58 |
+
# Animals/places use the app's exact emoji keys. The "A cute {animals} {places}"
|
| 59 |
+
# prefix is built by image_generator.build_subject; the detail adds rich props,
|
| 60 |
+
# activity and lighting for the cozy aesthetic. Deliberately mixes 1β3 animals
|
| 61 |
+
# and 1β3 places to mirror multi-emoji selections in the app.
|
| 62 |
# ---------------------------------------------------------------------------
|
| 63 |
|
| 64 |
+
SCENES: list[tuple[list[str], list[str], str]] = [
|
| 65 |
+
# ββ Solo animal, single place β covers all 12 animals + all 10 places ββ
|
| 66 |
+
(["π°"], ["π"], "sitting on a polka-dot toadstool, fireflies and floating spores drifting around, soft lantern glow"),
|
| 67 |
+
(["π±"], ["π"], "building a tiny sandcastle with a bucket and shells, gentle waves lapping, warm sunset sky"),
|
| 68 |
+
(["πΆ"], ["π‘"], "napping in a flower-filled wheelbarrow, watering can and butterflies nearby, golden afternoon light"),
|
| 69 |
+
(["π¦"], ["β"], "curled up on a fluffy cloud cradling a tiny glowing star, glittering night sky"),
|
| 70 |
+
(["πΌ"], ["πΈ"], "nibbling a dango skewer as petals fall, paper lanterns strung above, soft pink light"),
|
| 71 |
+
(["π¨"], ["π΄"], "hugging a palm trunk with a coconut drink, striped hammock and a parrot, turquoise sea behind"),
|
| 72 |
+
(["π¦"], ["π"], "wearing a tiny crown at the end of a rainbow, pastel clouds and floating sparkles"),
|
| 73 |
+
(["π―"], ["ποΈ"], "bundled in a knitted scarf on a snowy peak planting a tiny flag, sparkling snow and faint aurora"),
|
| 74 |
+
(["πΈ"], ["πΊ"], "perched on a giant hibiscus bloom, dewdrops glistening, big tropical leaves and warm bokeh"),
|
| 75 |
+
(["π§"], ["π"], "sitting on the curve of a glowing crescent moon in a knitted hat, scattered twinkling stars"),
|
| 76 |
+
(["π¦"], ["πΈ"], "fluttering through cherry blossoms trailing sparkles, pastel petals swirling in the breeze"),
|
| 77 |
+
(["π¦"], ["β"], "galloping across a starry sky, rainbow mane glowing, a trail of sparkles behind"),
|
| 78 |
+
(["πΆ"], ["π"], "exploring beneath a giant mushroom with a tiny lantern, glowing toadstools and soft moss"),
|
| 79 |
+
(["π±"], ["π"], "curled asleep on a crescent moon wearing a nightcap, twinkling stars all around"),
|
| 80 |
+
(["π°"], ["π"], "splashing in shallow waves beside a starfish friend, beach pail and spade, pink sunset"),
|
| 81 |
+
(["πΌ"], ["π‘"], "tending a vegetable patch in a straw hat, bees and tall sunflowers, warm sun"),
|
| 82 |
+
(["π§"], ["ποΈ"], "sliding down a snowy slope on its belly, scarf flying, sparkling powder snow"),
|
| 83 |
+
(["π¦"], ["π΄"], "lounging in a hammock between two palms with sunglasses, coconuts and calm ocean"),
|
| 84 |
+
(["π¦"], ["πΊ"], "snoozing in a field of tropical flowers, a butterfly on its nose, dappled golden light"),
|
| 85 |
+
(["π―"], ["πΈ"], "chasing falling cherry petals, paper lanterns above, soft pink and lilac tones"),
|
| 86 |
+
(["πΈ"], ["π"], "playing a tiny flute on a lily pad among glowing mushrooms, fireflies and reeds"),
|
| 87 |
+
(["π¦"], ["π"], "standing proudly under a rainbow, flower garland around its neck, pastel clouds"),
|
| 88 |
+
|
| 89 |
+
# ββ Two animals, single place ββ
|
| 90 |
+
(["π°", "π±"], ["π"], "roasting marshmallows over a tiny campfire, fireflies and glowing mushrooms, cozy night"),
|
| 91 |
+
(["πΆ", "π¦"], ["π"], "building a sandcastle together with shell flags, gentle waves at golden hour"),
|
| 92 |
+
(["πΌ", "π¨"], ["πΈ"], "sharing tea under a blooming cherry tree, paper lanterns, drifting petals"),
|
| 93 |
+
(["π¦", "π―"], ["π‘"], "tumbling over a ball of yarn in a cottage garden, picket fence and butterflies"),
|
| 94 |
+
(["π§", "π°"], ["ποΈ"], "ice skating on a frozen pond atop a snowy mountain, fairy lights, gentle snowfall"),
|
| 95 |
+
(["πΈ", "π¦"], ["πΊ"], "resting together on lily pads among tropical flowers, dragonflies and warm bokeh"),
|
| 96 |
+
(["π±", "πΆ"], ["π"], "stargazing from a crescent moon with a tiny brass telescope, soft constellations"),
|
| 97 |
+
(["π¦", "π°"], ["π"], "trotting side by side under a rainbow, flower garlands and floating sparkles"),
|
| 98 |
+
(["π¦", "πΌ"], ["π"], "reading a glowing storybook under a toadstool, a lantern and curious fireflies"),
|
| 99 |
+
(["π¨", "π§"], ["π΄"], "sipping coconut drinks on a tropical island, beach umbrella and gentle surf"),
|
| 100 |
+
(["π°", "π¦"], ["β"], "swinging on a swing hung from the stars, sparkles raining down, deep blue night"),
|
| 101 |
+
(["π±", "πΈ"], ["π"], "collecting shells in tide pools at low tide, a little net and a pastel sunset"),
|
| 102 |
+
|
| 103 |
+
# ββ Three animals, single place ββ
|
| 104 |
+
(["π°", "π±", "πΆ"], ["π"], "having a picnic on a checkered blanket among glowing mushrooms, lanterns and fireflies"),
|
| 105 |
+
(["π¦", "πΌ", "π¨"], ["πΈ"], "a tea party under cherry blossoms with tiny cups, paper lanterns and drifting petals"),
|
| 106 |
+
(["π¦", "π―", "πΈ"], ["π‘"], "playing tag through flower beds in a cottage garden, butterflies and warm sun"),
|
| 107 |
+
(["π§", "π°", "π±"], ["ποΈ"], "building a snowman on a snowy peak in matching scarves, sparkling snow, aurora above"),
|
| 108 |
+
(["π¦", "π¦", "π°"], ["π"], "dancing under a rainbow amid sparkles and flower petals, pastel sky"),
|
| 109 |
+
(["πΆ", "π¦", "πΌ"], ["π"], "surfing tiny waves together with a beach ball, palm trees and sunset glow"),
|
| 110 |
+
(["π±", "π¨", "πΈ"], ["πΊ"], "weaving flower crowns in a field of tropical flowers, butterflies and golden bokeh"),
|
| 111 |
+
(["π¦", "π―", "π°"], ["β"], "huddled on a cloud counting sparkling stars under a shared blanket, soft glow"),
|
| 112 |
+
|
| 113 |
+
# ββ Two places ββ
|
| 114 |
+
(["π°"], ["π", "π"], "hopping from a mushroom grove toward a rainbow, sparkles bridging the two, pastel light"),
|
| 115 |
+
(["π±", "πΆ"], ["π", "π΄"], "a beach day between ocean waves and a tropical island, palm shade and scattered shells"),
|
| 116 |
+
(["π¦"], ["β", "π"], "soaring past sparkling stars toward a crescent moon, a glowing rainbow trail"),
|
| 117 |
+
(["πΌ"], ["πΈ", "π‘"], "wandering from cherry blossoms into a cosy cottage garden, petals and busy bees"),
|
| 118 |
+
(["π§", "π°"], ["ποΈ", "β"], "watching sparkling stars from a snowy mountain top, fairy lights and soft snow"),
|
| 119 |
+
(["π¦"], ["πΊ", "π΄"], "exploring tropical flowers along a tropical island shore, parrots and warm bokeh"),
|
| 120 |
+
(["πΈ", "π¦"], ["πΈ", "πΊ"], "drifting between cherry blossoms and tropical flowers, dewdrops and floating petals"),
|
| 121 |
+
(["π¦"], ["π‘", "π"], "lazing in a cottage garden as a rainbow arcs overhead, butterflies and golden light"),
|
| 122 |
+
|
| 123 |
+
# ββ Three places ββ
|
| 124 |
+
(["π°", "π±"], ["π", "π", "β"], "a dreamy journey through a mushroom forest, under a rainbow and beneath sparkling stars, a glowing trail"),
|
| 125 |
+
(["π¦"], ["π", "β", "π"], "flying past a crescent moon and sparkling stars toward a rainbow, sparkles everywhere"),
|
| 126 |
+
(["πΆ", "π¦", "πΌ"], ["π", "π΄", "πΊ"], "a tropical adventure across a sunny beach, a tropical island and fields of flowers, parrots and surf"),
|
| 127 |
+
(["π§", "π°", "π±"], ["ποΈ", "β", "π"], "a starry night on a snowy peak under a crescent moon and sparkling stars, fairy lights and aurora"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
]
|
| 129 |
|
| 130 |
+
|
| 131 |
+
def _scene_name(idx: int, animals: list[str], places: list[str]) -> str:
|
| 132 |
+
"""Short readable label for logs, e.g. '03_panda_1a1p'."""
|
| 133 |
+
first = ANIMAL_MAP[animals[0]].replace("baby ", "")
|
| 134 |
+
return f"{idx:02d}_{first}_{len(animals)}a{len(places)}p"
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
# Build (name, full_prompt) using the SAME prefix builder + STYLE suffix as the app.
|
| 138 |
+
PROMPTS: list[tuple[str, str]] = [
|
| 139 |
+
(_scene_name(i + 1, a, p), f"{build_subject(a, p)}, {detail}, {STYLE}")
|
| 140 |
+
for i, (a, p, detail) in enumerate(SCENES)
|
| 141 |
+
]
|
| 142 |
|
| 143 |
# ---------------------------------------------------------------------------
|
| 144 |
+
# Generator using FLUX.2-dev via HuggingFace Inference API
|
| 145 |
# ---------------------------------------------------------------------------
|
| 146 |
|
| 147 |
# Provider β model routing:
|
| 148 |
+
# fal-ai β FLUX.2-dev (best quality; billed to HF Pro credits)
|
| 149 |
+
# hf-inference β FLUX.1-schnell (HF native fallback, lower quality)
|
| 150 |
PROVIDERS = {
|
| 151 |
+
"fal-ai": "black-forest-labs/FLUX.2-dev",
|
| 152 |
"hf-inference": "black-forest-labs/FLUX.1-schnell",
|
| 153 |
}
|
| 154 |
|