
image-generator-sd-webui
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.
- Installs
- 86
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/jim60105/copilot-prompt --skill image-generator-sd-webui- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads image-generator-sd-webui automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Image Generator (sd-webui API)
Overview
Drive a Stable Diffusion WebUI / Forge server through its REST API to enumerate available resources, run txt2img, poll progress, and interrupt jobs. Shell entrypoints under scripts/ share one curl client. Generation file mode uses a Python 3 helper to decode and validate PNG files and save metadata, returning only a compact path manifest.
Server connection
Before doing anything, confirm the server URL (and optional HTTP Basic Auth) with the user. Pass them as environment variables to every script:
export SD_WEBUI_URL="http://localhost:7860" # required, no trailing slash
export SD_WEBUI_USER="" # optional, HTTP Basic Auth
export SD_WEBUI_PASS="" # optional
If unset, scripts default to http://localhost:7860 with no auth.
Quick connectivity test (returns OK <url> on success, exits non-zero on failure):
scripts/probe.sh
Workflow
- Probe — Verify the server is reachable (
scripts/probe.sh). On failure, ask the user for the correct URL / credentials. - Enumerate & choose — List the resources to pick (models, modules, samplers, schedulers, styles) and ask the user to choose. Capture their choice verbatim in the API's English
name/title/model_name— sd-webui matches exactly, do not translate or rename. - Prompt — Obtain the positive prompt, negative prompt, and any extra params (steps, CFG, size). See "Prompt engineering" for sourcing these.
- Generate — Call
scripts/generate.shwith a request JSON file and--output-dirpointing to an absolute directory under the caller's session staging directory. It saves images and metadata locally and returns a compact path manifest. - (Optional) Track progress — While generation is running (in another shell / background), call
scripts/progress.shto printprogress(0–1),eta_relative, andstate. - (Optional) Cancel — Call
scripts/cancel.shto interrupt the current job.
Tasks
Listing available resources
| User wants | Command | API endpoint |
|---|---|---|
| Checkpoints (models) | scripts/list.sh models | GET /sdapi/v1/sd-models → array of {title, model_name, hash, ...} |
| Extra modules (TE / VAE, Forge-only) | scripts/list.sh modules | GET /sdapi/v1/sd-modules → array of {model_name, ...} |
| Samplers | scripts/list.sh samplers | GET /sdapi/v1/samplers → array of {name, aliases} |
| Schedulers | scripts/list.sh schedulers | GET /sdapi/v1/schedulers → array of {name, label} |
| Style presets | scripts/list.sh styles | GET /sdapi/v1/prompt-styles → array of {name, prompt, negative_prompt} |
| Upscalers | scripts/list.sh upscalers | GET /sdapi/v1/upscalers |
| LoRAs | scripts/list.sh loras | GET /sdapi/v1/loras |
| Embeddings | scripts/list.sh embeddings | GET /sdapi/v1/embeddings |
scripts/list.sh <kind> prints the canonical English identifier for each entry, one per line — pipe to column, fzf, etc. Add --json for the raw JSON.
After listing, present the options to the user (use ask_user with an enum if the list is short). For models, prefer the full title (which embeds the hash suffix, e.g. anima/animaika_v36.safetensors [d50fb5b9a0]) over model_name because the title is unambiguous — if the user supplies a bare filename without the hash, verify it via list.sh models and substitute the exact title before sending it to the API. For schedulers, list.sh schedulers prints the human-readable label (e.g. Beta); both label and the lowercase name (beta) are accepted by the txt2img scheduler field.
Generating an image (txt2img)
- Build a JSON request. Required field:
prompt. Recommended:negative_prompt,steps,cfg_scale,width,height,sampler_name,scheduler,styles(array of style names), andoverride_settings.sd_model_checkpoint(model title) /override_settings.forge_additional_modules(array of module names, Forge only). Seereferences/txt2img-parameters.mdfor every field. - Run:
scripts/generate.sh "/absolute/session/request.json" --output-dir "/absolute/session/generated" - Read the compact stdout manifest:
{"image_paths":["/absolute/session/generated/generation.ABC1234567/image-0001.png"],"metadata_path":"/absolute/session/generated/generation.ABC1234567/metadata.json"} - Use every
image_pathsentry as an absolute path for subsequent file processing or delivery. Readmetadata_pathonly when generation details are needed. Metadata contains all API response fields exceptimages, preservinginfounchanged (normally a JSON-encoded string).
File mode requires Python 3 in addition to curl and jq. It saves every returned image, including grids, in response order. Each invocation creates a private, uniquely named batch subdirectory, so repeated or concurrent calls do not overwrite files. Paths containing spaces are supported. Supply the output directory explicitly for the current session; never derive it from process-global SESSION_ID or TMPDIR. Keep prompts inside the request file, not shell arguments. No shell redirection or custom HTTP client is needed.
Failures exit nonzero without a success manifest. Failed batches are removed; if cleanup fails, stderr identifies the retained partial-output directory. Interruptions via SIGINT/SIGTERM also attempt cleanup; SIGKILL cannot run cleanup. Successful files remain until the caller cleans its staging directory after delivery. The caller must check exit status before using the manifest.
For existing integrations, omitting --output-dir retains the legacy full API JSON stdout response, including base64 images. Stdin requests (-) work in either mode. Use file mode for agent-facing delivery to avoid placing base64 in model context.
Important behaviour notes:
samples_formatpre-pin: sd-webui/Forge validatessamples_formatbefore applyingoverride_settings, so if the server's persistent value is unsupported (e.g.avif), txt2img fails.generate.shpreemptivelyPOSTssamples_format=pngto/sdapi/v1/optionsand redundantly injectsoverride_settings.samples_format=png. ⚠️ The pre-pin mutates the server's persistent default to"png"—override_settings_restore_afterwardscannot undo it. If the user shares the server with clients expecting a different default, restore manually after:scripts/options.sh set samples_format '"webp"'. Convert locally if you need non-PNG output (see "Converting to another format" below).override_settings_restore_afterwards: trueis forced on bygenerate.shso the otheroverride_settingskeys (model checkpoint, modules, VAE) do not stick.- Generation is synchronous — the POST blocks until the image is ready. The script uses a 600s curl timeout; override with
SD_WEBUI_TIMEOUT=900 scripts/generate.sh ....
Converting to another format
If the user wants the output in a non-PNG format (WebP, AVIF, JPEG, etc.), do not try to re-enable a different samples_format on the server. Instead, convert locally while preserving the embedded sd-webui generation metadata:
- Check whether both
format-converter.shandcopy-info.share available onPATH(e.g.command -v format-converter.sh && command -v copy-info.sh). - If both are present, run
format-converter.shon the PNG — it callscopy-info.shinternally to carry the parameters over. Runformat-converter.sh -hto see the current usage. - If either is missing, guide the user to install the helper project once: https://github.com/jim60105/sd-image-format-converter. It has system dependencies that must be set up manually, so it can't be auto-installed. After install, both scripts should be on
PATHand-hwill show usage.
Multi-axis comparison (X/Y/Z plot)
For comparing parameter variations in a single grid, use the x/y/z plot script. Read references/xyz-plot.md for the full 19-arg API structure, axis type index discovery, Prompt S/R syntax, and variant-specific pitfalls before implementing.
Tracking progress
Call from another terminal (or background the generate.sh call with & first):
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.job
Endpoint: GET /sdapi/v1/progress?skip_current_image=true. Key response fields:
progress— float 0..1, fraction of current job complete.eta_relative— estimated seconds remaining.state.job— current job name (empty string when idle).state.sampling_step/state.sampling_steps— current step index / total.current_image— base64 PNG preview of the in-progress image (omitted by the script viaskip_current_image=trueto keep responses small; fetch raw withcurlif needed).
Cancelling
scripts/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 batch
Note: interrupt is cooperative — it tells the sampler to stop at the next step. The pending generate.sh call will return with whatever the model produced so far (often a usable but partial image). It does not raise an HTTP error on the txt2img call.
Global options (advanced)
scripts/options.sh wraps GET /sdapi/v1/options and POST /sdapi/v1/options:
scripts/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-checkpoints
Prefer override_settings inside the txt2img request over options set — override_settings is request-scoped and reverts after the call, while options set persists globally and affects every other client.
Prompt engineering
This skill does not generate or refine prompts. When the user asks for prompt help:
- Check whether another agent skill is available for prompt engineering (search by name: e.g.
sd-prompt-builder,danbooru-prompt,image-prompt-*). If so, delegate to it. - Otherwise, ask the user for the prompt explicitly, or accept a natural-language description and pass it through verbatim as the
promptfield. Do not invent Danbooru tags or stylistic modifiers on your own.
References
references/api-endpoints.md— full sd-webui / Forge endpoint reference with request / response shapes for every endpoint this skill uses, plus useful adjacent ones (/sdapi/v1/memory,/sdapi/v1/png-info, etc.).references/txt2img-parameters.md— everytxt2imgrequest field including HiRes-fix, refiner, Forge-specific extensions (forge_additional_modules,forge_inference_memory,forge_preset), andoverride_settingskeys.references/xyz-plot.md— X/Y/Z plot script API: 19-arg structure, axis type indices, Prompt S/R format, runtime discovery viascript-info, and variant-specific pitfalls.
Read these only when constructing a non-trivial request or hitting an error that needs deeper investigation.
FAQ
What does the image-generator-sd-webui skill do?
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.
How do I install image-generator-sd-webui?
Run npx skills add https://github.com/jim60105/copilot-prompt --skill image-generator-sd-webui in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/image-generator-sd-webui/ (personal) or .claude/skills/image-generator-sd-webui/ (project).
Which AI agents can use image-generator-sd-webui?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is image-generator-sd-webui safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains image-generator-sd-webui?
It is published by jim60105 in jim60105/copilot-prompt. It has 86 recorded installs.
More from jim60105/copilot-prompt
chinese-content-writing-guideline
jim60105/copilot-prompt
Language-specific guidelines for producing high-quality Traditional Chinese (zh-TW) content: script, full-width punctuation, spacing, forms of address, grammar constraints, and Taiwan terminology. Includes the no-calque rule against literal translations of English phrasal verbs such as 折入 for fold in. Use when writing any kind of Chinese content. Including blog posts, notes, technical articles, technical writing, chitchat, social media posts, etc., even when you are just sending a text message. Also use when reviewing or editing existing Chinese content for language and terminology compliance. Always apply writing-style-guideline alongside this skill for structure, tone, rhetorical constraints, and banned phrases.
docx
jim60105/copilot-prompt
Open the skill to read its SKILL.md instructions.
jim60105/copilot-prompt
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
image-prompt-builder-nl
jim60105/copilot-prompt
Open the skill to read its SKILL.md instructions.
rewrite-meeting-audio-transcription
jim60105/copilot-prompt
Open the skill to read its SKILL.md instructions.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image