SKILL.md
Sophnet Image Generate
Overview
Generate Sophnet images with Python scripts that handle task polling and structured output.
Script responsibilities:
generateimage.py: core API caller and polling loop, outputs machine-friendlyTASKID,STATUS, andIMAGE_URL.generateandpreview.sh: wrapper for local use, callsgenerateimage.py, downloads first image, addsPREVIEWPATH.
When to Use
- User asks to generate an image with Sophnet models.
- Caller needs stable outputs like
TASKID,STATUS,IMAGEURL,PREVIEW_PATH. - Prompt includes model choice (
Z-Image-Turbo,Qwen-Image,Qwen-Image-Plus). - Do not use when the task is only to display an existing image URL/path; use
sophnet-smart-image-loader.
Quick Reference
| Goal | Command |
|---|---|
| Generate + local preview path | bash {baseDir}/scripts/generateandpreview.sh --prompt "..." |
| Generate URLs only | uv run --project {baseDir} python {baseDir}/scripts/generate_image.py --prompt "..." |
| Show script options | uv run --project {baseDir} python {baseDir}/scripts/generate_image.py --help |
Recommended defaults:
- Use
generateandpreview.shfor interactive local image preview. - Use
generate_image.pyfor automation/CI or when download is not needed.
Implementation
- Run the script with
--prompt. - Parse output lines by key prefix.
- Use
IMAGEURLto share with users (publicly accessible). UsePREVIEWPATHfor local image preview when present.
Common Mistakes
- Assuming
PREVIEWPATHexists when usinggenerateimage.py.