#!/bin/bash
# NEONCYBER - Dense Neon Interiors
# Shops, arcades, markets - layered neon signage
# Very popular on WE, almost no minimal anime style competition
# Usage: ./generate-neon-interiors.sh

set -e

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

echo "🏪 NEONCYBER - Dense Neon Interiors"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Layered neon signage, intimate spaces - WE popular theme"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""

PROMPTS=(
    # 1: Convenience store interior
    "Inside 24/7 cyberpunk convenience store with dense neon signage, minimal anime aesthetic. Overhead view down narrow aisle. Vertical magenta and cyan neon signs cover walls and ceiling. Refrigerators cast cold blue glow. Products on shelves barely visible in neon chaos. Empty store, nobody shopping. Atmospheric lighting layers. 1920x1080 widescreen, store interior masterpiece."

    # 2: Arcade corridor
    "Narrow arcade corridor packed with glowing game cabinets, cyberpunk glitch aesthetic. Tight hallway lined with vertical arcade machines. Purple, cyan, and magenta screens create overlapping light. Neon reflections on polished floor. Empty arcade, machines running idle. Pixel sorting on game screens. Nostalgic meets futuristic. 1920x1080 widescreen, arcade corridor quality."

    # 3: Ramen shop interior
    "Small ramen shop interior with dense Japanese neon menu signs, minimal anime style. Counter perspective looking at wall of vertical neon kanji signs. Red, cyan, and yellow neon layers overlap. Steam rising from kitchen implied by atmospheric haze. Empty shop, closed or waiting. Intimate cozy chaos. 1920x1080 widescreen, ramen shop masterpiece."

    # 4: Vending machine alley
    "Narrow alley completely lined with glowing vending machines, cyberpunk aesthetic. Tight passage between two walls of illuminated vending machines. Cyan, magenta, and orange machine screens create tunnel of light. Wet floor reflects double the neon. Empty atmospheric corridor. Glitch artifacts on machine displays. 1920x1080 widescreen, vending alley quality."

    # 5: Neon market corridor
    "Underground neon market hallway with vertical shop signs, glitch anime style. Claustrophobic corridor with signs jutting from both sides. Layered depth: signs in foreground, midground, background. Purple and cyan predominate with gold accents. Empty market after hours. Digital corruption on signs. Atmospheric fog between layers. 1920x1080 widescreen, market corridor masterpiece."

    # 6: Karaoke room hallway
    "Karaoke building hallway with numbered room doors and neon signs, minimal cyberpunk. Long corridor with doors on both sides. Each door has glowing room number and status light. Magenta carpet, cyan walls, purple ceiling lights. Empty hallway, muffled music implied. Geometric repeating pattern. Glitch on numbers. 1920x1080 widescreen, karaoke hall quality."

    # 7: Electronics shop chaos
    "Small electronics shop interior packed with glowing screens and neon, glitch aesthetic. Wall-to-wall screens showing static and test patterns. Cables everywhere. Multiple neon signs advertising brands. Cyan, magenta, green overlapping light chaos. Empty shop, screens running demos. Digital corruption everywhere. 1920x1080 widescreen, electronics shop masterpiece."

    # 8: Pachinko parlor view
    "Pachinko parlor interior with infinite glowing machines, minimal anime style. Rows and rows of identical glowing pachinko machines receding to vanishing point. Magenta and cyan machine lights create geometric pattern. Chrome balls reflect neon. Empty parlor, machines idle. Hypnotic repetition. Scan line glitch. 1920x1080 widescreen, pachinko parlor quality."

    # 9: Neon food court
    "Underground food court with multiple vendor stalls and hanging neon signs, cyberpunk aesthetic. Open area with various food stalls around perimeter. Overhead: forest of vertical neon signs in different languages. Purple, cyan, red, yellow light chaos. Empty seating area. Steam and atmospheric haze. Glitch on signs. 1920x1080 widescreen, food court masterpiece."

    # 10: Capsule hotel corridor
    "Capsule hotel corridor with glowing pod doors, minimal glitch aesthetic. Geometric wall of illuminated capsule entrances. Each pod has cyan interior light spilling out. Magenta corridor lighting. Perfect grid of rectangles. Empty hallway, guests inside pods. Futuristic minimalism meets neon chaos. Digital artifacts. 1920x1080 widescreen, capsule hotel quality."
)

DESCRIPTIONS=(
    "Convenience Store Interior"
    "Arcade Corridor"
    "Ramen Shop Interior"
    "Vending Machine Alley"
    "Neon Market Corridor"
    "Karaoke Room Hallway"
    "Electronics Shop Chaos"
    "Pachinko Parlor View"
    "Neon Food Court"
    "Capsule Hotel Corridor"
)

for i in {0..9}; do
    NUM=$((i + 1))
    PROMPT="${PROMPTS[$i]}"
    DESC="${DESCRIPTIONS[$i]}"

    echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
    echo "[$NUM/10] $DESC"
    echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

    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, customers, workers, characters, faces", "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/wp_interior_${TIMESTAMP}_v${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 to queue"
    fi
    echo ""
done

echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✨ All 10 neon interior variations queued!"
echo ""
echo "📁 Files: ComfyUI/output/wp/"
echo "  wp_interior_${TIMESTAMP}_v1_*.png - Convenience Store"
echo "  wp_interior_${TIMESTAMP}_v2_*.png - Arcade Corridor"
echo "  wp_interior_${TIMESTAMP}_v3_*.png - Ramen Shop"
echo "  wp_interior_${TIMESTAMP}_v4_*.png - Vending Machine Alley"
echo "  wp_interior_${TIMESTAMP}_v5_*.png - Neon Market Corridor"
echo "  wp_interior_${TIMESTAMP}_v6_*.png - Karaoke Hallway"
echo "  wp_interior_${TIMESTAMP}_v7_*.png - Electronics Shop"
echo "  wp_interior_${TIMESTAMP}_v8_*.png - Pachinko Parlor"
echo "  wp_interior_${TIMESTAMP}_v9_*.png - Neon Food Court"
echo "  wp_interior_${TIMESTAMP}_v10_*.png - Capsule Hotel"
echo ""
echo "🏪 Dense layered neon - WE gold!"
