Stable Diffusion (A1111) Commands & Prompt Reference
For the AUTOMATIC1111 Stable Diffusion web UI at release v1.10.1, the newest changelog entry, this page gathers prompt syntax, script syntax and the launch options used day to day, checked against the project wiki. Covered: attention weights, prompt editing, Composable Diffusion, extra networks, X/Y/Z plot ranges and Prompts from file fields; Settings-tab options, API endpoints and extension syntax are not. BREAK and AND are recognised only in capitals, and launch options belong in COMMANDLINE_ARGS, set in the webui-user script.
Also see: Stable Diffusion WebUI keyboard shortcuts.
All Commands
Attention and emphasis (6)
| Command / Syntax | What it does | Notes |
|---|---|---|
| (word) | Increase attention | Each pair of parentheses multiplies the weight of the enclosed words by 1.1. |
| ((word)) | Stacked emphasis | Every extra pair multiplies attention by 1.1 again, so two pairs equal an explicit weight of 1.21. |
| [word] | Decrease attention | Divides the weight by 1.1 per pair; brackets take no number, so write a weight below 1 in parentheses instead. |
| (word:1.5) | Set an explicit weight | Replaces the default 1.1 factor with the number given; numeric weights work only inside parentheses. |
| (word:0.25) | Weaken with a weight below 1 | Numbers under 1 shrink a token's influence; 0.25 divides its attention by four. |
| \(word\) | Literal parentheses | A backslash before ( ) or [ ] keeps the character as text, as in anime_\(character\). |
Prompt editing and structure (8)
| Command / Syntax | What it does | Notes |
|---|---|---|
| [from:to:when] | Prompt editing | A whole number switches after that step; a value between 0 and 1 switches after that share of all steps. |
| [to:when] | Add text after a step | The early steps run without this text; it joins the prompt once the given step or fraction is reached. |
| [from::when] | Remove text after a step | Note the double colon: the text guides the early steps and is dropped at the switch point. |
| [cow|horse] | Alternating words | The prompt changes option on every sampling step and loops back after the last; more than two options are allowed. |
| a cat AND a dog | Composable Diffusion | An uppercase AND splits the text into separate prompts that are combined, each with a default weight of 1. |
| a cat :1.2 AND a dog AND a penguin :2.2 | Weighted Composable Diffusion | A colon and number after a part set its weight; values under 0.1 barely change the result. |
| BREAK | Start a new token chunk | Prompts are encoded in 75-token chunks; uppercase BREAK pads the current one so later text starts the next. |
| # | Prompt comment | Since 1.8.0 the rest of the line after a hash is ignored and kept out of the saved PNG info. |
Extra networks and templates (6)
| Command / Syntax | What it does | Notes |
|---|---|---|
| <lora:filename:multiplier> | Apply a LoRA | File name without extension, strength usually 0 to 1; not allowed in the negative prompt or inside prompt editing. |
| <hypernet:filename:multiplier> | Apply a hypernetwork | Follows the LoRA rules; files live in models/hypernetworks and the multiplier sets how strongly it acts. |
| FILENAME | Textual Inversion embedding | Type the embedding file's name in the prompt; new files in the embeddings folder work without a restart. |
| {prompt} | Style prompt placeholder | Inside a saved style, marks where the current prompt goes instead of the style being appended at the end. |
| [name] | Embedding name tag | Only for textual inversion prompt template files, one prompt per line; it stands for the embedding being trained. |
| [filewords] | Caption from image filename | Inserts words from each training image's file name after stripping the extension and leading numbers and dashes. |
Comparison grids (7)
| Command / Syntax | What it does | Notes |
|---|---|---|
| a busy city street in a modern city|illustration|cinematic lighting | Prompt matrix | Run through Script, Prompt matrix: every combination of the pipe-separated parts is drawn with one seed, the first part in all. |
| 1-5 | X/Y/Z integer range | Typed into an X, Y or Z values field, it expands to each whole number including both ends. |
| 1-5 (+2) | Range with a step | The number in parentheses is the increment and may be fractional, such as +0.5. |
| 10-5 (-3) | Descending range | A negative increment counts down from the first number and stops before passing the second. |
| 1-10 [5] | Range with a value count | The bracketed number sets how many values are spread across the range, both ends included. |
| an apple, a watermelon, a gun | Prompt S/R list | The first entry is the search text found in the prompt; each later entry replaces it to make one more prompt. |
| darkness,"light, green",heat | S/R item containing a comma | The list is read like a CSV line: quote an item that holds a comma, with no space between quotes and commas. |
Prompts from file fields (15)
| Command / Syntax | What it does | Notes |
|---|---|---|
| --prompt PROMPT | Job prompt | Each line is one job run in order; when the UI prompt is filled, this text is added at its start or end. |
| --negative_prompt PROMPT | Job negative prompt | Quotes are optional for both prompt fields, since words up to the next option are joined; the text extends any UI negative prompt. |
| --steps N | Sampling steps | Applies to that line only; the next line starts again from the UI settings unless it sets its own. |
| --cfg_scale N | CFG scale | Read as a decimal number, unlike steps, width and height, which must be whole numbers. |
| --sampler_name NAME | Sampler | Quote names with spaces, such as DPM++ 2M Karras; the name is matched without regard to letter case. |
| --seed N | Seed | Overrides the UI seed for that line; otherwise the Iterate seed every line option can advance it per job. |
| --subseed N | Variation seed | The second seed that variation strength blends toward, set in the UI under the Extra checkbox. |
| --subseed_strength N | Variation strength | A decimal: the maximum gives the variation seed's picture, the minimum keeps the main seed's picture. |
| --width N | Image width | Whole number of pixels for that job, so one list can mix image sizes. |
| --height N | Image height | Pairs with the width field; the wiki example sets 1024 by 768 on one line and leaves the size alone on the next. |
| --batch_size N | Batch size | Images generated together in one batch; the line produces batch size times batch count images. |
| --n_iter N | Batch count | Each line's count is added to the job total that the script reports before it starts. |
| --seed_resize_from_w N | Seed resize source width | Width of the original image when a known seed is reused at a new resolution. |
| --seed_resize_from_h N | Seed resize source height | Set together with the width field; the wiki notes ancestral samplers hold the original look less well. |
| --sd_model MODEL | Checkpoint for the job | Switches to the closest matching checkpoint name; if none matches, the whole line is used as the prompt instead. |
Launch options for memory and speed (13)
| Command / Syntax | What it does | Notes |
|---|---|---|
| --xformers | Enable xFormers | NVIDIA cards only; in the wiki's test table it is the fastest cross-attention choice with low memory use. |
| --opt-sdp-attention | Scaled dot product attention | Can beat xFormers on some systems but needs more VRAM and gives slightly different results on each run. |
| --opt-sdp-no-mem-attention | Deterministic SDP attention | Repeatable results, at a little less speed and more VRAM than --opt-sdp-attention. |
| --medvram | Medium VRAM mode | Keeps only one of the three model parts in VRAM at a time, saving memory without a large speed loss. |
| --medvram-sdxl | Medium VRAM for SDXL only | Applies the --medvram behaviour only while an SDXL checkpoint is loaded. |
| --lowvram | Low VRAM mode | Splits the UNet further so only one module sits in VRAM; the wiki calls the speed loss devastating. |
| --upcast-sampling | Upcast sampling | First fix to try on cards without half-precision support; it has no effect when --no-half is also set. |
| --no-half-vae | Full-precision VAE | Keeps the VAE in 32-bit floats; the next fallback for green or black images before the slower --no-half. |
| --precision full | Full precision evaluation | Used together with --no-half when green or black images persist; the default precision is autocast. |
| --no-half | Full-precision model | Last resort for half-precision failures: much higher VRAM use, which may in turn require --medvram. |
| --disable-nan-check | Skip the NaN check | When one image of a batch fails with NaNs the others are still shown, which confirms a precision problem. |
| --use-cpu all | Run on the CPU | CPU-only runs also need --precision full, --no-half and --skip-torch-cuda-test, and generate very slowly. |
| --skip-torch-cuda-test | Skip the CUDA check | Avoids the Torch-cannot-use-GPU stop at startup on AMD, Mac or CPU setups where CUDA is absent. |
Launch options for server and folders (17)
| Command / Syntax | What it does | Notes |
|---|---|---|
| COMMANDLINE_ARGS | Default launch arguments | Set it in webui-user.bat with set, or in webui-user.sh with export, so the flags apply on every start. |
| --listen | Listen on the network | Binds to 0.0.0.0 so other machines on the local network can open the UI at this computer's address. |
| --port PORT | Server port | The default is 7860 when free; ports below 1024 need root or administrator rights. |
| --share | Public Gradio link | Gives an xxx.app.gradio address reachable online, meant for Colab; pair it with --gradio-auth to require a login. |
| --gradio-auth username:password | UI login | Several logins can be separated by commas, and --gradio-auth-path reads them from a file instead. |
| --api | Enable the API | Serves the API alongside the web UI; switch to --nowebui to run the API alone. |
| --api-auth username:password | API login | Requires a username and password on API requests; give several pairs separated by commas. |
| --nowebui | API without the UI | Starts the API server alone; --skip-load-model-at-start then avoids loading a model at launch. |
| --autolaunch | Open the browser at start | |
| --theme dark | Force dark or light theme | Accepts light or dark; without it the UI follows the browser's theme. |
| --ckpt-dir CKPT_DIR | Checkpoint folder | Points the checkpoint list at another directory; the wiki's webui-user example keeps models on a separate drive. |
| --lora-dir LORA_DIR | LoRA folder | Changes where LoRA files are read from; without it they load from models/Lora. |
| --embeddings-dir EMBEDDINGS_DIR | Embeddings folder | Moves the folder that textual inversion embeddings are read from, which defaults to embeddings. |
| --data-dir DATA_DIR | User data folder | Base location for user files; --models-dir can override where models are kept. |
| --enable-insecure-extension-access | Unlock the Extensions tab | Extension installs are blocked when --share, --listen, --ngrok or --server-name is set; this flag allows them anyway. |
| --disable-all-extensions | Start without extensions | Built-in extensions are skipped too; --disable-extra-extensions skips only the ones you installed. |
| --update-check | Check for updates at start | Reports whether the installed commit matches the current master branch when the UI starts. |
Recipes
Notes on combining the syntax above. The tokens used here are rows of the tables on this page.
Emphasise a token with an exact weight
(word:1.5)
Each pair of parentheses multiplies attention by 1.1, so ((word)) already means 1.21 and deeper nesting is hard to read. An explicit weight states the factor directly, and a value below 1, as in (word:0.25), weakens the token instead. Square brackets also weaken but accept no number.
Control where a long prompt is split
BREAK
The web UI encodes prompts in chunks of 75 tokens. An uppercase BREAK pads the current chunk, so the text after it starts a new chunk instead of being cut wherever the 75th token falls.
Change the subject partway through sampling
[from:to:when]
A whole number switches after that step, and a fraction between 0 and 1 switches after that share of the steps. Since 1.6.0, values from 1.0 to 2.0 target the hires fix pass. The later the switch, the less room the model has to draw the second text in place of the first. LoRA tags do not work inside prompt editing or alternating words.
Combine separate prompts
a cat :1.2 AND a dog AND a penguin :2.2
An uppercase AND turns each part into a prompt of its own. A weight after a part changes its share: the default is 1, and values under 0.1 barely change the picture.
Compare settings in a grid
1-10 [5]
In the X/Y/Z plot value fields, 1-5 lists every whole number, 1-5 (+2) steps by two and 1-10 [5] spreads five values over the range. With Prompt S/R, the first list entry is searched for in the prompt and replaced by each later entry in turn.
Queue jobs with different settings
--prompt "photo of winter mountains" --steps 7 --sampler_name "DDIM"
The Prompts from file or textbox script runs one job per line. In release v1.10.1 a line without any double-dash option is used as a plain prompt, and a line that fails to parse, for example because --sd_model names no known checkpoint, is also used whole as the prompt.
Frequently Asked Questions
How do I emphasize a word in a Stable Diffusion prompt?
Wrap it in parentheses to multiply its attention by 1.1, nest them to multiply again, or set the factor directly with (word:1.5). Square brackets lower attention but take no number; for an exact reduction use a weight below 1 in parentheses.
What is the difference between BREAK and AND?
Both must be uppercase. BREAK pads the current 75-token chunk so the following text starts a new chunk of the same prompt. AND splits the text into separate prompts for Composable Diffusion, and each part can carry its own weight.
How do I compare settings side by side?
Use the X/Y/Z plot script. Its value fields accept ranges such as 1-5, 1-5 (+2) for an increment or 1-10 [5] for a fixed count, and Prompt S/R swaps a search term for each later entry in its list.
Where do launch options such as --xformers go?
Add them to COMMANDLINE_ARGS in webui-user.bat on Windows (set COMMANDLINE_ARGS=...) or webui-user.sh on Linux (export COMMANDLINE_ARGS=...), so they apply every time the launcher starts the web UI.
Which launch options help with green or black images?
The project's troubleshooting page suggests --upcast-sampling first, then --no-half-vae, and as a last resort --precision full with --no-half, which costs much more VRAM and may need --medvram.
Sources and checks
- AUTOMATIC1111 stable-diffusion-webui wiki: Features Prompt syntax, extra networks, styles, Prompt matrix, X/Y/Z plot, Prompt S/R and Prompts from file rows
- AUTOMATIC1111 stable-diffusion-webui wiki: Command Line Arguments and Settings Launch option rows and the COMMANDLINE_ARGS variable
- stable-diffusion-webui v1.10.1: scripts/prompts_from_file.py How the Prompts from file or textbox script reads each job line in release v1.10.1
- stable-diffusion-webui v1.10.1: modules/cmd_args.py Launch options present in release v1.10.1; the --api row
- stable-diffusion-webui CHANGELOG (master branch, newest entry 1.10.1) Release named on this page; the --sd_model job field
- AUTOMATIC1111 stable-diffusion-webui wiki: Textual Inversion Embedding row and prompt template tags
- AUTOMATIC1111 stable-diffusion-webui wiki: Optimizations Memory and speed option rows
- AUTOMATIC1111 stable-diffusion-webui wiki: Troubleshooting Precision, NaN-check and CUDA-check option rows
Every row on this page was matched to a line in the documentation above on . A command or parameter that could not be found there is not listed.
1 row from the earlier version of this page was removed in that check: duplicates, and entries the documentation does not list or lists differently.
AI tools change their commands, parameters and model names between releases: the vendor's current documentation and the version you run have the last word. Found a wrong or missing entry? Tell us and it gets checked against the source. How we verify describes the process and its limits.
Related prompt references
Midjourney (46) · Kling AI (54) · Vidu (49) · All AI prompt references