...
| Code Block |
|---|
#!/usr/bin/env bash set -e API="http://12710.09.08.1207:7860" SCHED="$API/agent-scheduler/v1/queue/txt2img" # scheduler endpoint OPTIONS="$API/sdapi/v1/options" OUTDIR="outputs_matrix_v3" mkdir -p "$OUTDIR" # ---- GLOBAL SETTINGS (KEEP CONSTANT FOR FAIR COMPARISON) ---- STEPS=8 # 4,8,9 for Turbo models, 20-50 - for base CFG=1 # Guidance 1 - for turbo models, standart value for modern model is 4 AG=0 # Attension Guidance is used only by Qwen, Qwen 2512 WIDTH=1024 # Image width HEIGHT=1024 # Image height SAMPLER="Default" # Sampler SEED=20260425 # set -1 for random MODEL="${1:System}" #MODEL='Diffusers/baidu/ERNIE-Image-Turbo [54f8a75695]' # optionally pass model name # ---- PROMPTS ---- prompts=( "a red apple on a wooden table, soft natural lighting" "a small cabin in the mountains, watercolor painting, pastel tones" "portrait photo of a 35 year old man, neutral expression, studio lighting, 85mm lens" "a cat sitting in the center of a window frame, symmetrical composition, morning light" "a street scene at night illuminated only by neon blue and pink lights" "three glass bottles, one filled with red liquid, one blue, one green, arranged in a row on a reflective surface" "a chrome sphere and a matte black cube on a white surface, strong directional sunlight casting sharp shadows" "cinematic photo of a woman walking in rain, wet asphalt reflections, shot on 50mm lens, shallow depth of field" "a futuristic city skyline in the style of cyberpunk and art deco, highly detailed, dramatic lighting" "extreme low angle view of a towering skyscraper disappearing into fog, wide angle lens distortion" "a wooden chair placed on top of a table inside a small room, viewed from the doorway" "a chef flipping a pancake in mid air in a busy kitchen, motion blur, dynamic composition" "five birds sitting on a wire, each bird a different color and size" "a storefront sign that clearly reads \"OPEN 24 HOURS\", realistic street photography" "a candle lighting a dark room, objects gradually fading into shadow, realistic light falloff" "two identical twins, one wearing black suit and one wearing white suit, standing side by side, neutral background" "a cluttered desk with a laptop, a coffee mug, scattered papers, a glowing desk lamp, and a small plant near the edge" "a glass of water on a mirror surface reflecting a sunset sky, realistic reflections and refractions" "a hyper realistic photograph of a dragon sitting in a modern living room, natural lighting" "a perfectly centered circle inside a square frame, minimalistic design, high contrast black and white" ) # ---- SWITCH MODEL ---- if [ -n "$MODEL" ]; then echo "🔄 Switching model to: $MODEL" curl -s -X POST "$OPTIONS" \ -H "Content-Type: application/json" \ -d "{\"sd_model_checkpoint\": \"$MODEL\"}" > /dev/null sleep 3 fi50 CFG=4 AG=4 WIDTH=1024 HEIGHT=1024 SAMPLER="Default" SEED=20260425 MODEL="Diffusers/Qwen/Qwen-Image-2512 [25468b98e3]" # ✅ fixed: added missing - # ---- PROMPTS ---- prompts=( "a red apple on a wooden table, soft natural lighting" "a small cabin in the mountains, watercolor painting, pastel tones" "portrait photo of a 35 year old man, neutral expression, studio lighting, 85mm lens" "a cat sitting in the center of a window frame, symmetrical composition, morning light" "a street scene at night illuminated only by neon blue and pink lights" "three glass bottles, one filled with red liquid, one blue, one green, arranged in a row on a reflective surface" "a chrome sphere and a matte black cube on a white surface, strong directional sunlight casting sharp shadows" "cinematic photo of a woman walking in rain, wet asphalt reflections, shot on 50mm lens, shallow depth of field" "a futuristic city skyline in the style of cyberpunk and art deco, highly detailed, dramatic lighting" "extreme low angle view of a towering skyscraper disappearing into fog, wide angle lens distortion" "a wooden chair placed on top of a table inside a small room, viewed from the doorway" "a chef flipping a pancake in mid air in a busy kitchen, motion blur, dynamic composition" "five birds sitting on a wire, each bird a different color and size" "a storefront sign that clearly reads \"OPEN 24 HOURS\", realistic street photography" "a candle lighting a dark room, objects gradually fading into shadow, realistic light falloff" "two identical twins, one wearing black suit and one wearing white suit, standing side by side, neutral background" "a cluttered desk with a laptop, a coffee mug, scattered papers, a glowing desk lamp, and a small plant near the edge" "a glass of water on a mirror surface reflecting a sunset sky, realistic reflections and refractions" "a hyper realistic photograph of a dragon sitting in a modern living room, natural lighting" "a perfectly centered circle inside a square frame, minimalistic design, high contrast black and white" ) # ---- QUEUE JOBS ---- i=1 for prompt in "${prompts[@]}"; do printf "[QUEUE %02d] %s\n" "$i" "$prompt" json=$(jq -n \ --arg prompt "$prompt" \ --arg checkpoint "$MODEL" \ --arg sampler "$SAMPLER" \ --argjson steps $STEPS \ --argjsonarg cfgcheckpoint $CFG"$MODEL" \ --argjson agcfg $AG$CFG \ --argjson wag $WIDTH$AG \ --argjson hw $HEIGHT$WIDTH \ --argjson seed $SEED \ --arg name "matrix_v3_$(printf "%02d" $i)" \ '{h $HEIGHT \ --argjson seed name:$SEED $name,\ request: '{ sd_model_checkpoint: $checkpoint, prompt: $prompt, steps: $steps, cfg_scale: $cfg, pagpag_scale: $ag, width: $w, height: $h, sampler_name: $sampler, seed: $seed, batch_size: 1, n_iter: 1, save_images: true } }'images: true }') TASK_NAME="$(printf '%02d' $i) ${prompt:0:16}" ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$TASK_NAME") curl -s -X POST "$SCHED?name=$ENCODED" \ -H "Content-Type: application/json" \ -d "$json" > /dev/null ((i++)) done echo "✅ All jobs queued in scheduler" |