#!/bin/bash
# NEONCYBER - 100 Image Creative Showcase
# Organized themed batches for easy comparison
# Usage: ./generate-showcase-100.sh

set -e

COMFYUI="http://192.168.1.57:8188"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)

echo "🎨 NEONCYBER - 100 IMAGE CREATIVE SHOWCASE"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Organized showcase of everything we've explored"
echo "Estimated time: ~100 minutes (1.6 hours)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""

# Counter for total images
TOTAL=0

# Function to queue image
queue_image() {
    local BATCH=$1
    local NUM=$2
    local PROMPT=$3
    local DESC=$4

    TOTAL=$((TOTAL + 1))

    echo "[$TOTAL/100] $BATCH-$NUM: $DESC"

    WORKFLOW=$(cat <<EOF
{
  "prompt": {
    "1": {"inputs": {"unet_name": "z_image_turbo_bf16.safetensors", "weight_dtype": "default"}, "class_type": "UNETLoader"},
    "2": {"inputs": {"clip_name": "qwen_3_4b.safetensors", "type": "qwen_image"}, "class_type": "CLIPLoader"},
    "3": {"inputs": {"vae_name": "ae.safetensors"}, "class_type": "VAELoader"},
    "4": {"inputs": {"text": "$PROMPT", "clip": ["2", 0]}, "class_type": "CLIPTextEncode"},
    "5": {"inputs": {"text": "low quality, blurry, people, crowds, busy", "clip": ["2", 0]}, "class_type": "CLIPTextEncode"},
    "6": {"inputs": {"width": 1920, "height": 1080, "batch_size": 1}, "class_type": "EmptyLatentImage"},
    "7": {"inputs": {"seed": $(python3 -c "import random; print(random.randint(1, 2**32-1))"), "steps": 8, "cfg": 1.0, "sampler_name": "euler", "scheduler": "sgm_uniform", "denoise": 1, "model": ["1", 0], "positive": ["4", 0], "negative": ["5", 0], "latent_image": ["6", 0]}, "class_type": "KSampler"},
    "8": {"inputs": {"samples": ["7", 0], "vae": ["3", 0]}, "class_type": "VAEDecode"},
    "9": {"inputs": {"filename_prefix": "wp/showcase_${TIMESTAMP}_${BATCH}_${NUM}", "images": ["8", 0]}, "class_type": "SaveImage"}
  }
}
EOF
)

    RESPONSE=$(curl -s -X POST "$COMFYUI/prompt" -H "Content-Type: application/json" -d "$WORKFLOW")
    PROMPT_ID=$(echo "$RESPONSE" | python3 -c "import sys, json; print(json.load(sys.stdin).get('prompt_id', ''))" 2>/dev/null || echo "")

    if [ -n "$PROMPT_ID" ]; then
        echo "  ✅ Queued: $PROMPT_ID"
    else
        echo "  ❌ Failed"
    fi
}

echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH A: Pixel Glitch Techniques (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "A" "01" "Cyberpunk alley with vertical pixel sorting, neon signs streak down in magenta cyan columns. Minimal anime style. 1920x1080 widescreen." "Vertical Pixel Sort"
queue_image "A" "02" "Street with horizontal RGB chromatic aberration, reality splits into red green blue offset. Glitch aesthetic. 1920x1080 widescreen." "RGB Shift"
queue_image "A" "03" "Convenience store with JPEG databending artifacts, block compression errors. Magenta cyan corruption. 1920x1080 widescreen." "Databending"
queue_image "A" "04" "Alley with scan line cascade glitch, upper stable lower dissolving into color bars. Anime style. 1920x1080 widescreen." "Scan Lines"
queue_image "A" "05" "Street with displacement map warp, neon bends like fabric under stress. Cyberpunk glitch. 1920x1080 widescreen." "Displacement"
queue_image "A" "06" "Platform with interlacing artifacts, odd even lines offset creating comb effect. Minimal style. 1920x1080 widescreen." "Interlacing"
queue_image "A" "07" "Corridor with posterization glitch, colors reduced to 4-bit CGA palette bands. Retro aesthetic. 1920x1080 widescreen." "Posterization"
queue_image "A" "08" "Alley with mirror glitch, reality duplicates and reflects incorrectly. Digital corruption. 1920x1080 widescreen." "Mirror Glitch"
queue_image "A" "09" "Street with bloom overflow, neon bleeds excessively creating abstract halos. Cyberpunk style. 1920x1080 widescreen." "Bloom Overflow"
queue_image "A" "10" "Store with bitcrush reduction, image reduced to low bit depth creating banding. Glitch aesthetic. 1920x1080 widescreen." "Bitcrush"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH B: Color Palettes (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "B" "01" "Cyberpunk street in magenta and cyan CGA palette with pixel sort. Minimal anime. 1920x1080 widescreen." "Magenta/Cyan"
queue_image "B" "02" "Alley in orange and teal cinema grade color. Blade Runner aesthetic. 1920x1080 widescreen." "Orange/Teal"
queue_image "B" "03" "Platform in pure red and cyan anaglyph 3D colors with chromatic split. Retro glitch. 1920x1080 widescreen." "Red/Cyan"
queue_image "B" "04" "Street in toxic green and deep purple radioactive palette. Cyberpunk corruption. 1920x1080 widescreen." "Green/Purple"
queue_image "B" "05" "Corridor in gold and black luxury minimal. Single color elegance. 1920x1080 widescreen." "Gold/Black"
queue_image "B" "06" "Alley in pastel pink and mint green vaporwave aesthetic. Soft glitch. 1920x1080 widescreen." "Pink/Mint"
queue_image "B" "07" "Store in electric blue and amber warm/cool contrast. Neon nights. 1920x1080 widescreen." "Blue/Amber"
queue_image "B" "08" "Street in violet and lime acid colors. High energy cyberpunk. 1920x1080 widescreen." "Violet/Lime"
queue_image "B" "09" "Platform in silver and crimson metallic palette. Industrial glitch. 1920x1080 widescreen." "Silver/Crimson"
queue_image "B" "10" "Alley in pure white and black stark contrast ink aesthetic. Minimal noir. 1920x1080 widescreen." "White/Black"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH C: B/W + Single Color (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "C" "01" "Black white alley, only single neon sign in magenta. Selective color. 1920x1080 widescreen." "Magenta Sign"
queue_image "C" "02" "Monochrome street, only vending machine in cyan. Film noir aesthetic. 1920x1080 widescreen." "Cyan Vending"
queue_image "C" "03" "Grayscale city, only rain in purple. Empty atmospheric. 1920x1080 widescreen." "Purple Rain"
queue_image "C" "04" "Black white hangar, only hazard lights in orange. Industrial minimal. 1920x1080 widescreen." "Orange Hazard"
queue_image "C" "05" "Monochrome store, only exit sign in red. Cinematic focus. 1920x1080 widescreen." "Red Exit"
queue_image "C" "06" "Grayscale alley, only puddle reflections in gold. Surreal contrast. 1920x1080 widescreen." "Gold Reflections"
queue_image "C" "07" "Black white corridor, only emergency strip in green. Safety aesthetic. 1920x1080 widescreen." "Green Emergency"
queue_image "C" "08" "Monochrome platform, only train headlights in yellow. Arrival moment. 1920x1080 widescreen." "Yellow Headlights"
queue_image "C" "09" "Grayscale street, only one car taillight in red. Motion frozen. 1920x1080 widescreen." "Red Taillight"
queue_image "C" "10" "Black white store, only open sign in blue. Late night vibe. 1920x1080 widescreen." "Blue Open Sign"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH D: Impossible Geometry (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "D" "01" "Mecha hangar with Penrose triangle architecture impossibly looping. Cyan magenta lights. 1920x1080 widescreen." "Penrose Triangle"
queue_image "D" "02" "Garage where walls unfold like tesseract 4D geometry. Purple neon edges. 1920x1080 widescreen." "Tesseract Unfold"
queue_image "D" "03" "Platform with Mobius strip conveyor, single sided topology. Yellow hazard stripes. 1920x1080 widescreen." "Mobius Strip"
queue_image "D" "04" "Storage with fractal cathedral infinite recursive pillars. Cyan purple sacred geometry. 1920x1080 widescreen." "Fractal Cathedral"
queue_image "D" "05" "Workshop with Klein bottle fuel tanks, no inside outside. Cyan coolant paradox. 1920x1080 widescreen." "Klein Bottle"
queue_image "D" "06" "Bay with hypercube projection mecha parts phasing through 4D. Magenta chrome. 1920x1080 widescreen." "Hypercube"
queue_image "D" "07" "Corridor with Escher stairs recursive impossible staircase. Monochrome minimal. 1920x1080 widescreen." "Escher Stairs"
queue_image "D" "08" "Room with non-Euclidean architecture angles that don't add up. Purple haze. 1920x1080 widescreen." "Non-Euclidean"
queue_image "D" "09" "Space with impossible triangle frame structure floating. Cyan wire frame. 1920x1080 widescreen." "Impossible Triangle"
queue_image "D" "10" "Area with paradox cube geometric contradiction. Magenta cyan edges. 1920x1080 widescreen." "Paradox Cube"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH E: Marathon/Sci-Fi (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "E" "01" "Ancient alien terminal room green phosphor text, cyan circuits. Marathon aesthetic. 1920x1080 widescreen." "Terminal Room"
queue_image "E" "02" "Pfhor alien architecture purple red angular harsh shadows. Far future brutalist. 1920x1080 widescreen." "Pfhor Design"
queue_image "E" "03" "Cyborg maintenance bay green monitors cyan diagnostics. Geometric charging stations. 1920x1080 widescreen." "Cyborg Bay"
queue_image "E" "04" "Jjaro artifact chamber impossible perfect geometry cyan purple energy. Ancient alien. 1920x1080 widescreen." "Jjaro Chamber"
queue_image "E" "05" "S'pht compiler terminal green code purple circuits. Alien AI architecture. 1920x1080 widescreen." "S'pht Terminal"
queue_image "E" "06" "Deep space colony hub green emergency lights cyan nav symbols. Desolate brutalist. 1920x1080 widescreen." "Colony Hub"
queue_image "E" "07" "Vacuum corridor orange hazard lights minimalist industrial. Far future lonely. 1920x1080 widescreen." "Vacuum Corridor"
queue_image "E" "08" "Orbital station purple atmospheric lighting geometric windows. Space brutalism. 1920x1080 widescreen." "Orbital Station"
queue_image "E" "09" "AI core room cyan matrix patterns geometric server towers. Digital cathedral. 1920x1080 widescreen." "AI Core"
queue_image "E" "10" "Cryosleep chamber blue frost green status lights. Far future preservation. 1920x1080 widescreen." "Cryosleep"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH F: Anime Aesthetics (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "F" "01" "Blade Runner spinner police car landing orange cyan beams purple rain. Film noir. 1920x1080 widescreen." "Blade Runner"
queue_image "F" "02" "Industrial power lines brutalist electrical towers purple orange Eva palette. Oppressive scale. 1920x1080 widescreen." "Eva Power Lines"
queue_image "F" "03" "Abandoned Vespa and bass guitar magenta cyan graffiti. FLCL rebellious energy. 1920x1080 widescreen." "FLCL Chaos"
queue_image "F" "04" "Arcade cabinet alley CRT glow pixelated reflections. 80s retro gaming culture. 1920x1080 widescreen." "Arcade Alley"
queue_image "F" "05" "Neon ramen shop narrow alley steam rising. Late night anime atmosphere. 1920x1080 widescreen." "Ramen Alley"
queue_image "F" "06" "Rooftop antenna silhouette layered purple city. Contemplative anime mood. 1920x1080 widescreen." "Rooftop View"
queue_image "F" "07" "Train platform purple arriving fog pink warning lights. Empty transit atmosphere. 1920x1080 widescreen." "Train Platform"
queue_image "F" "08" "Telephone wires crossing purple twilight orange street lights. Anime melancholy. 1920x1080 widescreen." "Wire Crossing"
queue_image "F" "09" "Vending machine wall glowing shrine of consumerism. Dystopian beauty. 1920x1080 widescreen." "Vending Shrine"
queue_image "F" "10" "Highway underpass wet concrete cyan emergency lights. Urban geometric. 1920x1080 widescreen." "Underpass"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH G: Urban Scenes (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "G" "01" "Classic empty street wet pavement pink cyan neon reflections. Purple vending machine. 1920x1080 widescreen." "Classic Street"
queue_image "G" "02" "Alley stairs descending purple haze overhead neon signs. Moody depth atmosphere. 1920x1080 widescreen." "Alley Stairs"
queue_image "G" "03" "Convenience store 24-hour bright interior cyan purple spill. Empty late night. 1920x1080 widescreen." "Convenience Store"
queue_image "G" "04" "Parking garage geometric concrete pillars cyan lighting. Industrial minimal. 1920x1080 widescreen." "Parking Garage"
queue_image "G" "05" "Subway tunnel curved walls orange work lights. Urban infrastructure. 1920x1080 widescreen." "Subway Tunnel"
queue_image "G" "06" "Fire escape zigzag metal stairs purple twilight. Vertical composition. 1920x1080 widescreen." "Fire Escape"
queue_image "G" "07" "Loading dock yellow hazard stripes cyan roll-up doors. Industrial geometry. 1920x1080 widescreen." "Loading Dock"
queue_image "G" "08" "Pedestrian bridge suspended walkway purple fog below. Elevated perspective. 1920x1080 widescreen." "Pedestrian Bridge"
queue_image "G" "09" "Bike parking area geometric metal racks cyan lighting. Urban pattern. 1920x1080 widescreen." "Bike Parking"
queue_image "G" "10" "Bus stop shelter transparent walls pink neon bench. Waiting atmosphere. 1920x1080 widescreen." "Bus Stop"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH H: Abstract Concepts (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "H" "01" "Architecture melting upward liquid chrome defying gravity. Purple sky reverse flow. 1920x1080 widescreen." "Liquid Gravity"
queue_image "H" "02" "City folded holographic origami translucent cyan magenta creases. Dimensional paper crane. 1920x1080 widescreen." "Holographic Origami"
queue_image "H" "03" "Archaeological dig vertical strata compressed neon light layers. Temporal sediment. 1920x1080 widescreen." "Neon Archaeology"
queue_image "H" "04" "Street quantum superposition multiple color timelines overlapping. Probability collapse. 1920x1080 widescreen." "Quantum Superposition"
queue_image "H" "05" "Corridor time crystallized geometric shards frozen moments. Temporal debris. 1920x1080 widescreen." "Crystallized Time"
queue_image "H" "06" "Scene negative space inversion solid becomes void. Magenta cyan figure-ground reversal. 1920x1080 widescreen." "Negative Inversion"
queue_image "H" "07" "Reality rendered as sound waves visual frequency spectrum. Cyan purple amplitude. 1920x1080 widescreen." "Sound Visualization"
queue_image "H" "08" "Space fractured like broken mirror each shard different angle. Kaleidoscope reality. 1920x1080 widescreen." "Mirror Fracture"
queue_image "H" "09" "Architecture decomposed into wireframe mesh gradually. Digital dissolution. 1920x1080 widescreen." "Wireframe Decay"
queue_image "H" "10" "Environment compressed into data barcode vertical stripes. Information density. 1920x1080 widescreen." "Data Compression"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH I: Atmospheric Moods (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "I" "01" "Heavy rain purple bokeh cyan neon bleeding. Melancholic atmosphere. 1920x1080 widescreen." "Heavy Rain"
queue_image "I" "02" "Dense fog magenta glow diffused. Mysterious limited visibility. 1920x1080 widescreen." "Dense Fog"
queue_image "I" "03" "Light snow orange street light purple shadows. Quiet winter night. 1920x1080 widescreen." "Light Snow"
queue_image "I" "04" "Steam rising green neon cyan vents. Industrial warmth escaping. 1920x1080 widescreen." "Rising Steam"
queue_image "I" "05" "Smoke drifting purple haze orange embers. Post-activity lingering. 1920x1080 widescreen." "Drifting Smoke"
queue_image "I" "06" "Wind motion blur streaking neon. Dynamic energy flowing. 1920x1080 widescreen." "Wind Motion"
queue_image "I" "07" "Reflections only no direct view puddle mirror world. Inverted perspective. 1920x1080 widescreen." "Pure Reflections"
queue_image "I" "08" "Lens flare excessive magenta cyan star burst. Optical overwhelm. 1920x1080 widescreen." "Lens Flare"
queue_image "I" "09" "Silhouettes only back-lit figures no detail. Mystery shadow play. 1920x1080 widescreen." "Pure Silhouette"
queue_image "I" "10" "Extreme depth of field one plane focus rest blur. Selective reality. 1920x1080 widescreen." "Depth Isolation"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "BATCH J: Wild Cards (10 images)"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

queue_image "J" "01" "Asemic corrupted kanji melting into abstract glitch symbols. Digital calligraphy decay. 1920x1080 widescreen." "Asemic Text"
queue_image "J" "02" "CGA 4-color dithering crosshatch patterns magenta cyan black white. Retro computer aesthetic. 1920x1080 widescreen." "CGA Dithering"
queue_image "J" "03" "VHS tracking errors horizontal noise purple scan artifacts. Analog corruption. 1920x1080 widescreen." "VHS Tracking"
queue_image "J" "04" "Phosphor CRT glow green terminal burn-in ghosting. Retro monitor aesthetic. 1920x1080 widescreen." "CRT Phosphor"
queue_image "J" "05" "Circuit board patterns cyan traces geometric chip layouts. Electronic mandala. 1920x1080 widescreen." "Circuit Patterns"
queue_image "J" "06" "Hexagonal tiling honeycomb structure magenta cells. Geometric tessellation. 1920x1080 widescreen." "Hexagonal Tiling"
queue_image "J" "07" "Voronoi diagram cellular divisions cyan purple territories. Mathematical partitioning. 1920x1080 widescreen." "Voronoi Cells"
queue_image "J" "08" "Triangulation low-poly geometric facets gradient. Polygon reduction aesthetic. 1920x1080 widescreen." "Triangulation"
queue_image "J" "09" "Scanline overlay interlaced alternating transparency. CRT simulation. 1920x1080 widescreen." "Scanline Overlay"
queue_image "J" "10" "Chromatic aberration rainbow edge separation prism split. Optical distortion beauty. 1920x1080 widescreen." "Prism Split"

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✨ ALL 100 IMAGES QUEUED!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📁 Output: ComfyUI/output/wp/"
echo "   Format: showcase_${TIMESTAMP}_[BATCH]_[NUM]_*.png"
echo ""
echo "📊 Breakdown:"
echo "   Batch A: Pixel Glitch Techniques (10)"
echo "   Batch B: Color Palettes (10)"
echo "   Batch C: B/W + Single Color (10)"
echo "   Batch D: Impossible Geometry (10)"
echo "   Batch E: Marathon/Sci-Fi (10)"
echo "   Batch F: Anime Aesthetics (10)"
echo "   Batch G: Urban Scenes (10)"
echo "   Batch H: Abstract Concepts (10)"
echo "   Batch I: Atmospheric Moods (10)"
echo "   Batch J: Wild Cards (10)"
echo ""
echo "⏱️  Estimated completion: ~100 minutes (1.6 hours)"
echo "💾 Total disk space: ~100-200MB"
echo ""
echo "🎨 Sleep well - tomorrow you'll have 100 wallpapers to choose from!"
