flux-fast-aoti / mega_marathon.sh
asahiner's picture
Upload folder using huggingface_hub
92c4f2c verified
#!/bin/bash
# 🎨 MEGA IMAGE GENERATION MARATHON - 200 Creative Prompts
# πŸ“… 2025-01-06 - Ultimate creative diversity test
# 🎯 Target: 150-200 unique artistic images
set -e
# 🌟 Environment setup - Same as quick_test.sh approach (works!)
echo "πŸ” Environment check..."
echo "Current Python: $(which python)"
echo "Python version: $(python --version)"
# Don't exit if environment check fails, just continue with current env
# πŸš€ Performance optimizations
export OMP_NUM_THREADS=16
export MKL_NUM_THREADS=16
export NUMBA_NUM_THREADS=16
export CUDA_ALLOC_CONF=expandable_segments:True
export CUDA_LAUNCH_BLOCKING=0
# πŸ“ Create output directory
MARATHON_DIR="marathon_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$MARATHON_DIR"
# 🎯 MASSIVE PROMPT COLLECTION - 200 diverse creative prompts
PROMPTS=(
# 🌟 Fantasy & Mythology (20)
"A majestic dragon with crystalline scales perched on a floating mountain, aurora borealis dancing in background"
"An ancient phoenix rising from ashes in a mystical forest, golden feathers glowing with inner fire"
"A unicorn with rainbow mane galloping through a field of luminescent flowers under starlight"
"A wise wizard's tower floating among clouds, magical energy swirling around ancient stone walls"
"An elegant elven city built within giant tree branches, bridges of light connecting crystal dwellings"
"A powerful griffin soaring over snow-capped peaks, wings spread wide against storm clouds"
"A mystical mermaid's underwater palace made of coral and pearls, bioluminescent sea creatures swimming nearby"
"An ancient centaur archer in an enchanted glade, bow drawn with arrow of pure light"
"A magical portal opening between two worlds, energy crackling with rainbow lightning"
"A celestial pegasus flying through nebula clouds among distant stars and planets"
"A mighty kraken emerging from ocean depths, tentacles wreathed in ethereal blue flame"
"An ice queen's crystalline castle in arctic wasteland, aurora dancing overhead"
"A fire elemental dancing in volcanic landscape, lava flows creating rivers of light"
"A forest spirit made of vines and flowers, ancient eyes glowing with earth magic"
"A thunderbird soaring through storm clouds, lightning crackling from its wings"
"An underwater dragon swimming through kelp forests, scales shimmering like jewels"
"A celestial sphinx guarding temple gates, riddles written in floating golden text"
"A wind spirit taking form of translucent dancer, leaves and petals swirling around"
"A mountain giant awakening from stone slumber, moss and trees growing on shoulders"
"A lunar goddess floating in star-filled void, silver light emanating from flowing robes"
# πŸ€– Sci-Fi & Cyberpunk (20)
"A cyberpunk cityscape at night with flying cars, holographic advertisements, neon reflections on wet streets"
"A sleek spaceship approaching alien planet, multiple moons visible in purple sky"
"An android with glowing circuits visible through translucent skin, electric blue eyes"
"A space station orbiting gas giant, solar panels gleaming, small shuttles docking"
"A cybernetic warrior in futuristic armor, energy weapons charging with blue plasma"
"An alien marketplace on distant world, strange creatures trading exotic goods"
"A time machine laboratory with swirling temporal energy, gears and crystals floating"
"A robot city with towering mechanical spires, steam and electricity in the air"
"A portal to parallel dimension showing alternate reality through shimmering barrier"
"A futuristic underwater city with transparent domes, submarines gliding between buildings"
"A cyberpunk hacker in neon-lit server room, multiple holographic displays floating"
"An alien forest with bioluminescent plants, strange creatures with multiple eyes"
"A mech warrior standing in ruined cityscape, weapons systems glowing red"
"A space elevator reaching into orbital ring, Earth visible far below"
"A quantum computer core with floating data streams, reality bending around edges"
"An interstellar trading post with ships from different alien civilizations"
"A cybernetic tree growing through abandoned city, nature reclaiming technology"
"A holographic concert in zero gravity, performers floating among the audience"
"An AI consciousness visualized as geometric patterns in digital space"
"A terraforming machine transforming barren planet, atmosphere generators working"
# πŸ›οΈ Historical & Cultural (20)
"An ancient Egyptian pyramid under starry night, hieroglyphs glowing with mystical energy"
"A medieval castle on cliff overlooking stormy sea, lightning illuminating stone towers"
"A Japanese pagoda in cherry blossom garden, koi pond reflecting pink petals"
"A Viking longship sailing through icy fjords, northern lights dancing overhead"
"An ancient Greek temple with marble columns, olive trees and Mediterranean sunset"
"A Mayan pyramid in jungle clearing, exotic birds and tropical plants surrounding"
"A Chinese dragon boat festival on misty river, lanterns floating on water"
"An African tribal village with traditional huts, acacia trees and savanna sunset"
"A Native American teepee camp in prairie landscape, wild horses running free"
"An ancient Roman amphitheater with ivy-covered walls, golden hour lighting"
"A Polynesian outrigger canoe on crystal clear lagoon, tropical islands in distance"
"A Tibetan monastery on mountain peak, prayer flags fluttering in mountain wind"
"An Arabian desert caravan with camels, sand dunes and oasis palm trees"
"A Celtic stone circle at dawn, druids performing ancient rituals"
"An Aztec temple complex with stepped pyramids, feathered serpent carvings"
"A Russian orthodox church with golden domes, snow-covered onion spires"
"An Indian palace with intricate architecture, elephants and lotus gardens"
"A Venetian canal scene with gondolas, Renaissance buildings reflecting in water"
"A Scottish highland castle in misty glen, bagpiper on rocky outcrop"
"A Persian garden with geometric patterns, fountains and exotic flowers"
# 🌿 Nature & Landscapes (25)
"A majestic redwood forest with sunbeams filtering through ancient giant trees"
"A pristine mountain lake reflecting snow-capped peaks, wildflowers in foreground"
"A tropical waterfall cascading into emerald pool, exotic birds and butterflies"
"A desert oasis with palm trees, clear spring water, and camels resting"
"An autumn forest with golden leaves falling, deer grazing in peaceful clearing"
"A coral reef teeming with colorful fish, sea turtles and tropical marine life"
"A volcanic landscape with lava flows, steam vents and dramatic rock formations"
"A bamboo grove with filtered green light, peaceful paths winding through"
"A highland meadow filled with wildflowers, mountain backdrop and clear sky"
"An arctic tundra with polar bears, ice formations and aurora borealis"
"A rainforest canopy view with exotic birds, monkeys and hanging vines"
"A coastal cliff scene with crashing waves, seabirds and lighthouse"
"A prairie grassland with rolling hills, wildflowers swaying in gentle breeze"
"A crystal cave with stalactites, underground lake and glowing minerals"
"A sand dune landscape at sunset, camel caravan crossing golden sands"
"A alpine meadow with snow-capped mountains, wildflowers and clear stream"
"A mangrove swamp with twisted roots, exotic birds and still water"
"A canyon landscape with red rock formations, cactus and desert sunset"
"A boreal forest in winter, snow-laden evergreens and frozen stream"
"A temperate rainforest with moss-covered trees, ferns and misty atmosphere"
"A savanna scene with acacia trees, giraffes and African sunset"
"A fjord landscape with steep cliffs, waterfalls and fishing boats"
"A wetland ecosystem with herons, cattails and morning mist"
"A badlands formation with eroded rocks, fossils and desert plants"
"A geological wonder with colored rock layers, natural arches and petroglyphs"
# 🎨 Abstract & Artistic (25)
"A swirling galaxy of colors, abstract cosmic dance, paint flowing like stardust"
"Geometric patterns morphing into organic forms, mathematical beauty in motion"
"A surreal dreamscape with floating islands, impossible architecture, M.C. Escher style"
"Color symphony visualization, musical notes becoming visible light and energy"
"Abstract representation of time, clock faces melting like Salvador Dali painting"
"Emotional landscape showing joy as golden light, sadness as blue rain"
"Fractal patterns expanding infinitely, self-similar structures in brilliant colors"
"A painting that paints itself, brushes dancing in air creating masterpiece"
"Liquid light flowing through crystal prisms, creating rainbow waterfalls"
"A city made entirely of musical instruments, sound waves visible in air"
"Abstract portrayal of thoughts, neural networks glowing with electric ideas"
"A garden where flowers are gemstones, growing from metallic soil"
"Impossible physics visualization, gravity flowing upward in spiral patterns"
"A clockwork universe with visible gears, springs and pendulums in space"
"Abstract representation of seasons changing, time-lapse in single image"
"A library where books float open, words flowing like rivers of knowledge"
"Crystalline structures growing from mathematical equations, beauty of science"
"A painting that exists in multiple dimensions, perspective constantly shifting"
"Abstract ocean where waves are made of light, sea creatures are constellations"
"A forest where trees are giant pencils, drawing the sky with their tips"
"Musical instruments morphing into animals, creating symphony of hybrid creatures"
"A city built from clouds, architecture made of condensed water vapor"
"Abstract representation of wind, invisible force made visible through color"
"A painting that shows the soul of color, each hue expressing emotion"
"Geometric forms dancing to unheard music, mathematical ballet in space"
# πŸ™οΈ Architecture & Cities (20)
"A futuristic eco-city with vertical gardens, clean energy and sustainable design"
"An underwater metropolis with transparent domes, fish swimming between buildings"
"A floating city in the clouds, connected by bridges of light and energy"
"A desert city carved into canyon walls, architecture blending with rock"
"A tree-city where buildings grow from living wood, natural and architectural harmony"
"A crystal city reflecting rainbow light, transparent structures and prism buildings"
"A steampunk metropolis with brass gears, steam pipes and clockwork towers"
"A mountain city built into cliff faces, stone bridges connecting rocky peaks"
"A polar city with ice architecture, aurora lights and thermal energy"
"A jungle city with buildings wrapped in vines, nature and civilization merged"
"A coastal city with buildings on stilts, boats navigating between structures"
"A volcanic city using geothermal energy, buildings designed around lava flows"
"A city in autumn leaves, buildings disguised as giant trees with golden foliage"
"A minimalist city with clean lines, white architecture and zen gardens"
"A retrofuture city from 1950s vision, flying cars and atomic age design"
"A bio-organic city where buildings appear grown rather than built"
"A city of bridges connecting multiple islands, water taxis and elevated walkways"
"A solar city with buildings covered in panels, collecting and storing sunlight"
"A city built inside a giant tree, spiral staircases winding up the trunk"
"A nomadic city that moves with the seasons, portable architecture and vehicles"
# πŸ¦‹ Animals & Creatures (25)
"A majestic white tiger with blue eyes walking through bamboo forest"
"A family of elephants at watering hole during golden hour safari sunset"
"A graceful swan family swimming in misty lake with mountain reflections"
"A colorful toucan perched on tropical branch, rainforest canopy background"
"A wise old owl sitting on ancient oak branch under full moon"
"A pack of wolves running through snow-covered pine forest"
"A magnificent eagle soaring over canyon with wings spread wide"
"A playful dolphin pod jumping through ocean waves at sunset"
"A lazy panda eating bamboo in peaceful grove, black and white harmony"
"A proud peacock displaying brilliant tail feathers in royal garden"
"A family of sea otters floating on backs in kelp forest"
"A hummingbird hovering at exotic flower, wings creating motion blur"
"A majestic lion pride resting under acacia tree in African savanna"
"A butterfly migration with thousands of monarchs filling the sky"
"A curious fox kit playing in wildflower meadow"
"A whale family swimming in deep blue ocean with sunlight filtering down"
"A chameleon changing colors on tropical branch, eyes moving independently"
"A family of penguins sliding on ice with aurora in background"
"A jaguar stalking through misty rainforest, spotted coat gleaming"
"A seahorse family dancing among coral in crystal clear water"
"A red cardinal perched on snow-covered evergreen branch"
"A koala family sleeping in eucalyptus tree, peaceful and content"
"A monarch butterfly emerging from chrysalis, wings unfurling slowly"
"A family of meerkats standing guard in Kalahari desert"
"A snow leopard leaping across mountain ravine, perfectly adapted to terrain"
# 🌸 Seasons & Weather (15)
"Spring cherry blossoms in full bloom, petals falling like pink snow"
"Summer thunderstorm with dramatic lightning over wheat fields"
"Autumn maple forest with leaves in brilliant reds, oranges and golds"
"Winter wonderland with snow-covered evergreens and icicles sparkling"
"Morning mist rising from calm lake, sun breaking through fog"
"Rainbow after summer rain, vibrant arc over green landscape"
"First snow of winter on autumn leaves, seasonal transition captured"
"Summer solstice sunset with golden light lasting for hours"
"Spring rain creating puddles that reflect blooming flowers"
"Autumn harvest moon rising over cornfield, orange glow on stalks"
"Winter blizzard with snow swirling around bare trees"
"Summer drought with cracked earth and heat waves visible"
"Spring flooding with water reflecting sky and trees"
"Autumn fog rolling through valley, obscuring distant mountains"
"Winter ice storm coating everything in crystal clear ice"
)
echo "🎨 MEGA MARATHON STARTING!"
echo "πŸ“Š Target: ${#PROMPTS[@]} unique creative images"
echo "πŸ“ Output directory: $MARATHON_DIR"
echo "πŸ›‘οΈ NSFW Filter: DISABLED for maximum creativity"
echo "⏱️ Estimated time: $((${#PROMPTS[@]} * 15 / 60)) minutes"
echo ""
# πŸ“Š Initial system status
echo "πŸ–₯️ System Status at Start:"
echo " RAM: $(free -h | awk '/^Mem:/ {print $3 "/" $2}')"
echo " GPU: $(nvidia-smi --query-gpu=memory.used,memory.total --format=csv,noheader,nounits | awk '{print $1 "/" $2 " MB"}')"
echo " CPU: $(nproc) cores, Load: $(uptime | awk -F'load average:' '{print $2}')"
echo ""
TOTAL_START=$(date +%s)
SUCCESS_COUNT=0
BATCH_SIZE=25 # Status update every 25 images
# πŸ”„ Generate images for each prompt
for i in "${!PROMPTS[@]}"; do
PROMPT="${PROMPTS[$i]}"
# Create numbered filename with category hints
if [ $i -lt 20 ]; then
CATEGORY="fantasy"
elif [ $i -lt 40 ]; then
CATEGORY="scifi"
elif [ $i -lt 60 ]; then
CATEGORY="historical"
elif [ $i -lt 85 ]; then
CATEGORY="nature"
elif [ $i -lt 110 ]; then
CATEGORY="abstract"
elif [ $i -lt 130 ]; then
CATEGORY="architecture"
elif [ $i -lt 155 ]; then
CATEGORY="animals"
else
CATEGORY="seasons"
fi
TIMESTAMP=$(date +"%H%M%S")
OUTPUT_FILE="${MARATHON_DIR}/mega_$(printf "%03d" $((i+1)))_${CATEGORY}_${TIMESTAMP}.png"
echo "🎯 [$(date '+%H:%M:%S')] Image $((i+1))/${#PROMPTS[@]} ($CATEGORY)"
echo " Prompt: ${PROMPT:0:80}..."
START_TIME=$(date +%s)
# 🎨 Generate image with optimized settings
if timeout 45s python gen_image_stable.py \
--ckpt "runwayml/stable-diffusion-v1-5" \
--prompt "$PROMPT" \
--output-file "$OUTPUT_FILE" \
--device cuda \
--num_inference_steps 8 \
--seed $RANDOM \
--disable-nsfw-filter > /dev/null 2>&1; then
DURATION=$(($(date +%s) - START_TIME))
if [ -f "$OUTPUT_FILE" ]; then
SIZE=$(stat -c%s "$OUTPUT_FILE")
echo " βœ… Success! ${DURATION}s, $(echo "scale=1; $SIZE/1024" | bc)KB"
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
else
echo " ❌ Failed: File not created"
fi
else
echo " ⏰ Timeout or error"
fi
# πŸ“Š Progress update every BATCH_SIZE images
if [ $((i % BATCH_SIZE)) -eq $((BATCH_SIZE - 1)) ] || [ $i -eq $((${#PROMPTS[@]} - 1)) ]; then
ELAPSED=$(($(date +%s) - TOTAL_START))
AVG_TIME=$((ELAPSED / (i + 1)))
REMAINING=$(((${#PROMPTS[@]} - i - 1) * AVG_TIME))
echo ""
echo "πŸ“Š Progress Update:"
echo " Completed: $((i+1))/${#PROMPTS[@]} ($(echo "scale=1; (($i+1)*100)/${#PROMPTS[@]}" | bc)%)"
echo " Successful: $SUCCESS_COUNT"
echo " Elapsed: ${ELAPSED}s ($(($ELAPSED/60))m)"
echo " Remaining: ~${REMAINING}s (~$(($REMAINING/60))m)"
echo " GPU: $(nvidia-smi --query-gpu=memory.used,temperature.gpu --format=csv,noheader,nounits | awk '{print $1 "MB, " $2 "Β°C"}')"
echo ""
fi
# πŸ”„ Brief pause between generations to prevent overheating
sleep 1
done
TOTAL_DURATION=$(($(date +%s) - TOTAL_START))
echo ""
echo "πŸŽ‰ MEGA MARATHON COMPLETE!"
echo "=========================================="
echo "πŸ“Š Final Statistics:"
echo " Total Prompts: ${#PROMPTS[@]}"
echo " Successful: $SUCCESS_COUNT"
echo " Failed: $((${#PROMPTS[@]} - SUCCESS_COUNT))"
echo " Success Rate: $(echo "scale=1; ($SUCCESS_COUNT*100)/${#PROMPTS[@]}" | bc)%"
echo " Total Time: ${TOTAL_DURATION}s ($(($TOTAL_DURATION/60))m $(($TOTAL_DURATION%60))s)"
echo " Average per Image: $(($TOTAL_DURATION / ${#PROMPTS[@]}))s"
echo " Images per Minute: $(echo "scale=1; $SUCCESS_COUNT*60/$TOTAL_DURATION" | bc)"
echo ""
# πŸ“Š Final system status
echo "πŸ–₯️ Final System Status:"
echo " RAM: $(free -h | awk '/^Mem:/ {print $3 "/" $2}')"
echo " GPU: $(nvidia-smi --query-gpu=memory.used,memory.total,temperature.gpu --format=csv,noheader,nounits | awk '{print $1 "/" $2 " MB, " $3 "Β°C"}')"
echo ""
# πŸ“ Summary of generated files
echo "πŸ“ Generated Files Summary:"
echo " Directory: $MARATHON_DIR"
echo " File count: $(ls -1 "$MARATHON_DIR"/*.png 2>/dev/null | wc -l)"
echo " Total size: $(du -sh "$MARATHON_DIR" 2>/dev/null | cut -f1)"
echo ""
# πŸ“‹ Category breakdown
echo "πŸ“‹ Category Breakdown:"
echo " Fantasy: $(ls -1 "$MARATHON_DIR"/*fantasy*.png 2>/dev/null | wc -l) images"
echo " Sci-Fi: $(ls -1 "$MARATHON_DIR"/*scifi*.png 2>/dev/null | wc -l) images"
echo " Historical: $(ls -1 "$MARATHON_DIR"/*historical*.png 2>/dev/null | wc -l) images"
echo " Nature: $(ls -1 "$MARATHON_DIR"/*nature*.png 2>/dev/null | wc -l) images"
echo " Abstract: $(ls -1 "$MARATHON_DIR"/*abstract*.png 2>/dev/null | wc -l) images"
echo " Architecture: $(ls -1 "$MARATHON_DIR"/*architecture*.png 2>/dev/null | wc -l) images"
echo " Animals: $(ls -1 "$MARATHON_DIR"/*animals*.png 2>/dev/null | wc -l) images"
echo " Seasons: $(ls -1 "$MARATHON_DIR"/*seasons*.png 2>/dev/null | wc -l) images"
echo ""
echo "🎨 Marathon completed! Check $MARATHON_DIR for all generated images!"
echo "πŸ–ΌοΈ Use 'ls $MARATHON_DIR/' to browse files"
echo "πŸ“Š Use 'identify $MARATHON_DIR/*.png | head -10' to check image details"
echo ""
echo "πŸŽ‰ Happy image browsing when you return!"