Use this skill to run a provider-agnostic text-to-image pipeline with free-quota-first routing, token rotation, and prompt enhancement.
{baseDir}/assets/config.example.yaml or user-provided config.--provider auto follows routing.provider_order).requested -> z-image-turbo -> provider default).
--count > 1, and rotate provider/token start position per image to spread load.Install dependencies:
python -m pip install -r {baseDir}/scripts/requirements.txt
Run generation:
python {baseDir}/scripts/run_text2img.py --prompt "cinematic rainy tokyo alley" --json
Run with explicit provider/model:
python {baseDir}/scripts/run_text2img.py --prompt "a fox astronaut" --provider gitee --model flux-2 --json
Save image locally:
python {baseDir}/scripts/run_text2img.py --prompt "retro sci-fi city" --output ./out.png
Generate multiple images in one run:
python {baseDir}/scripts/run_text2img.py --prompt "anime passport portrait" --count 4 --json
Use {baseDir}/scripts/run_text2img.py with the fixed contract:
--prompt (required)
--provider (auto|huggingface|gitee|modelscope|a4f|openai_compatible, default auto)--model (default z-image-turbo)
--aspect-ratio (default 1:1)
--seed (optional int)
--steps (optional int)
--guidance-scale (optional float)
--enable-hd (flag)
--optimize-prompt / --no-optimize-prompt (default on)
--auto-translate / --no-auto-translate (default off)
--config (default {baseDir}/assets/config.example.yaml)--output (optional output file path)--count (number of images in one run, default 1)--json (structured output)When --json is used, output these fields on success:
id
url
provider
model
prompt_original
prompt_final
seed
steps
guidance_scale
aspect_ratio
fallback_chain
elapsed_ms
On failure, output structured error fields:
error_type
error
fallback_chainWhen --count > 1, JSON output contains:
countimages (array of standard success payloads)elapsed_msRead only what is needed:
references/provider-endpoints.mdreferences/model-matrix.mdreferences/token-rotation-policy.mdreferences/prompt-optimization-policy.mdreferences/openclaw-integration.mdKeep this skill focused on text-to-image core only.
Do not add image editing, video generation, or cloud storage workflows in this skill.
共 1 个版本