Tuzi Multi-model Image Generation
Use the bundled Python script to call the synchronous Tuzi image endpoint and save the returned images locally.
Security
- Prefer the standard
TUZI_API_KEYenvironment variable. - Allow a deployment to set
TUZI_API_KEY_ENVto the name of its generated credential variable. If neither is set, allow exactly one injectedCOZE_TUZI_API_*variable. - Allow
TUZI_API_KEY_FILEonly for a runtime-mounted secret file that is not bundled in the Skill. - For a local Codex or desktop Agent, allow the user to run
scripts/configure_key.pyonce. Store the Key in the current user's private configuration directory, never in the Skill directory. - Never request that the user paste the key into chat, a prompt, or a command argument.
- Never print, log, or return the Key. Store it only in the current user's private credential location or the Agent platform's secret manager.
- If no credential is injected, stop and ask the user to configure it as a secret in the current Agent runtime. Never add a real key to a source file or ZIP.
Workflow
Read references/models.md when selecting a model or using model-specific options. Read references/runtime.md when configuring credentials or diagnosing an Agent sandbox.
If a local desktop runtime reports that no Key exists, run the configuration script. Let the user type into the hidden GUI or terminal prompt; never ask them to send the Key in chat:
python3 <skill-directory>/scripts/configure_key.pyIn a remote or deployed Agent, use the platform's secret credential UI instead.
Use the user's requested model when supported. Otherwise choose:
seedream-5.0for ordinary text-to-image generation.seedream-4.5for multiple reference images.gpt-image-1for quality, output format, or transparent-background controls.nano-banana-2for Gemini/Nano Banana text-to-image generation.flux-kontext-profor one reference image, an explicit seed, or a native aspect ratio.
Run
scripts/generate_image.py. Pass an absolute output directory when the runtime requires files in a specific workspace; otherwise let the script create a temporary directory.Check the JSON result. Treat
code: 0as success and usesaved_filesas the deliverables.Return the saved images to the user. Do not claim success when no file was saved.
Command
python3 <skill-directory>/scripts/generate_image.py \
--prompt "一只蓝色兔子,白色背景,扁平插画" \
--model seedream-5.0 \
--size 2K
Common optional arguments:
--aspect-ratio 16:9
--reference-image https://example.com/reference.png
--max-images 2
--watermark
--quality high
--output-format png
--background transparent
--seed 42
--output-dir /absolute/path/to/generated-images
Repeat --reference-image for multiple Seedream reference images. Do not pass both --size and --aspect-ratio.
Failure handling
- Report the returned
msgconcisely whencodeis nonzero. - Do not silently remove unsupported parameters; rerun only after selecting a compatible model or option.
- If outbound HTTPS or local script execution is unavailable, state that the runtime cannot execute this Skill and do not fabricate an image.
- A development sandbox may omit deployment credentials. Treat that as an unverified live path, not as an API failure; retry after deployment or with a locally configured secret.
- Do not substitute an arbitrary base URL or an unlisted model.