Loading...
Loading...
Generate images via the Stable Diffusion WebUI / Forge HTTP API (AUTOMATIC1111-compatible `/sdapi/v1/*`). Use when the user wants to (1) discover or pick a model / extra module (TE/VAE) / sampler / scheduler / style preset from a running sd-webui server, (2) generate an image with a given prompt (txt2img), (3) check generation progress, (4) cancel/interrupt an in-flight generation, (5) inspect or change a global sd-webui option (e.g. active checkpoint), or (6) test connectivity. This skill talks to a *generic* sd-webui-compatible server (AUTOMATIC1111, Forge, reForge, sd-webui-forge-classic). Do NOT trigger for requests that are purely writing the prompt itself.
npx skill4agent add jim60105/copilot-prompt image-generator-sd-webuitxt2imgscripts/curlexport SD_WEBUI_URL="http://localhost:7860" # required, no trailing slash
export SD_WEBUI_USER="" # optional, HTTP Basic Auth
export SD_WEBUI_PASS="" # optionalhttp://localhost:7860OK <url>scripts/probe.shscripts/probe.shnametitlemodel_namescripts/generate.shinfoscripts/progress.shprogresseta_relativestatescripts/cancel.sh| User wants | Command | API endpoint |
|---|---|---|
| Checkpoints (models) | | |
| Extra modules (TE / VAE, Forge-only) | | |
| Samplers | | |
| Schedulers | | |
| Style presets | | |
| Upscalers | | |
| LoRAs | | |
| Embeddings | | |
scripts/list.sh <kind>columnfzf--jsonask_usertitleanima/animaika_v36.safetensors [d50fb5b9a0]model_namelist.sh modelslist.sh schedulerslabelBetalabelnamebetaschedulerpromptnegative_promptstepscfg_scalewidthheightsampler_nameschedulerstylesoverride_settings.sd_model_checkpointoverride_settings.forge_additional_modulesreferences/txt2img-parameters.mdscripts/generate.sh request.json > result.json
# or pipe:
cat request.json | scripts/generate.sh - > result.jsonjq -r '.images[0]' result.json | base64 -d > out.pnginfoseedall_promptssampler_namejq -r '.info | fromjson'samples_formatsamples_formatoverride_settingsavifgenerate.shPOSTsamples_format=png/sdapi/v1/optionsoverride_settings.samples_format=png"png"override_settings_restore_afterwardsscripts/options.sh set samples_format '"webp"'override_settings_restore_afterwards: truegenerate.shoverride_settingsSD_WEBUI_TIMEOUT=900 scripts/generate.sh ...samples_formatformat-converter.shcopy-info.shPATHcommand -v format-converter.sh && command -v copy-info.shformat-converter.shcopy-info.shformat-converter.sh -hPATH-hgenerate.sh&scripts/progress.sh # one-shot, prints JSON
scripts/progress.sh --watch # poll every 1s until progress reaches 1.0 or state.job is empty
scripts/progress.sh --watch --interval 2
scripts/progress.sh --field progress # just the numeric 0..1 value
scripts/progress.sh --field state.jobGET /sdapi/v1/progress?skip_current_image=trueprogresseta_relativestate.jobstate.sampling_stepstate.sampling_stepscurrent_imageskip_current_image=truecurlscripts/cancel.sh # POST /sdapi/v1/interrupt — stop current job, return current partial result
scripts/cancel.sh --skip # POST /sdapi/v1/skip — skip current job in a batchinterruptgenerate.shscripts/options.shGET /sdapi/v1/optionsPOST /sdapi/v1/optionsscripts/options.sh get # print all options as JSON
scripts/options.sh get sd_model_checkpoint # print one key
scripts/options.sh set sd_model_checkpoint '"<title>"' # set one key (value is JSON; string must be quoted)
scripts/options.sh set-json '{"k1":"v1","k2":"v2"}' # set multiple keys
scripts/options.sh refresh-checkpoints # POST /sdapi/v1/refresh-checkpointsoverride_settingstxt2imgoptions setoverride_settingsoptions setsd-prompt-builderdanbooru-promptimage-prompt-*promptreferences/api-endpoints.md/sdapi/v1/memory/sdapi/v1/png-inforeferences/txt2img-parameters.mdtxt2imgforge_additional_modulesforge_inference_memoryforge_presetoverride_settings