Stable Diffusion (A1111) Commands & Prompt Reference

72 commands & parameters · 7 categories · Sources: AUTOMATIC1111 stable-diffusion-webui wiki: Features and 7 more · Checked

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 / SyntaxWhat it doesNotes
(word)Increase attentionEach pair of parentheses multiplies the weight of the enclosed words by 1.1.
((word))Stacked emphasisEvery extra pair multiplies attention by 1.1 again, so two pairs equal an explicit weight of 1.21.
[word]Decrease attentionDivides 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 weightReplaces the default 1.1 factor with the number given; numeric weights work only inside parentheses.
(word:0.25)Weaken with a weight below 1Numbers under 1 shrink a token's influence; 0.25 divides its attention by four.
\(word\)Literal parenthesesA backslash before ( ) or [ ] keeps the character as text, as in anime_\(character\).

Prompt editing and structure (8)

Command / SyntaxWhat it doesNotes
[from:to:when]Prompt editingA 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 stepThe early steps run without this text; it joins the prompt once the given step or fraction is reached.
[from::when]Remove text after a stepNote the double colon: the text guides the early steps and is dropped at the switch point.
[cow|horse]Alternating wordsThe prompt changes option on every sampling step and loops back after the last; more than two options are allowed.
a cat AND a dogComposable DiffusionAn 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.2Weighted Composable DiffusionA colon and number after a part set its weight; values under 0.1 barely change the result.
BREAKStart a new token chunkPrompts are encoded in 75-token chunks; uppercase BREAK pads the current one so later text starts the next.
#Prompt commentSince 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 / SyntaxWhat it doesNotes
<lora:filename:multiplier>Apply a LoRAFile name without extension, strength usually 0 to 1; not allowed in the negative prompt or inside prompt editing.
<hypernet:filename:multiplier>Apply a hypernetworkFollows the LoRA rules; files live in models/hypernetworks and the multiplier sets how strongly it acts.
FILENAMETextual Inversion embeddingType the embedding file's name in the prompt; new files in the embeddings folder work without a restart.
{prompt}Style prompt placeholderInside a saved style, marks where the current prompt goes instead of the style being appended at the end.
[name]Embedding name tagOnly for textual inversion prompt template files, one prompt per line; it stands for the embedding being trained.
[filewords]Caption from image filenameInserts words from each training image's file name after stripping the extension and leading numbers and dashes.

Comparison grids (7)

Command / SyntaxWhat it doesNotes
a busy city street in a modern city|illustration|cinematic lightingPrompt matrixRun through Script, Prompt matrix: every combination of the pipe-separated parts is drawn with one seed, the first part in all.
1-5X/Y/Z integer rangeTyped into an X, Y or Z values field, it expands to each whole number including both ends.
1-5 (+2)Range with a stepThe number in parentheses is the increment and may be fractional, such as +0.5.
10-5 (-3)Descending rangeA negative increment counts down from the first number and stops before passing the second.
1-10 [5]Range with a value countThe bracketed number sets how many values are spread across the range, both ends included.
an apple, a watermelon, a gunPrompt S/R listThe first entry is the search text found in the prompt; each later entry replaces it to make one more prompt.
darkness,"light, green",heatS/R item containing a commaThe 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 / SyntaxWhat it doesNotes
--prompt PROMPTJob promptEach line is one job run in order; when the UI prompt is filled, this text is added at its start or end.
--negative_prompt PROMPTJob negative promptQuotes are optional for both prompt fields, since words up to the next option are joined; the text extends any UI negative prompt.
--steps NSampling stepsApplies to that line only; the next line starts again from the UI settings unless it sets its own.
--cfg_scale NCFG scaleRead as a decimal number, unlike steps, width and height, which must be whole numbers.
--sampler_name NAMESamplerQuote names with spaces, such as DPM++ 2M Karras; the name is matched without regard to letter case.
--seed NSeedOverrides the UI seed for that line; otherwise the Iterate seed every line option can advance it per job.
--subseed NVariation seedThe second seed that variation strength blends toward, set in the UI under the Extra checkbox.
--subseed_strength NVariation strengthA decimal: the maximum gives the variation seed's picture, the minimum keeps the main seed's picture.
--width NImage widthWhole number of pixels for that job, so one list can mix image sizes.
--height NImage heightPairs with the width field; the wiki example sets 1024 by 768 on one line and leaves the size alone on the next.
--batch_size NBatch sizeImages generated together in one batch; the line produces batch size times batch count images.
--n_iter NBatch countEach line's count is added to the job total that the script reports before it starts.
--seed_resize_from_w NSeed resize source widthWidth of the original image when a known seed is reused at a new resolution.
--seed_resize_from_h NSeed resize source heightSet together with the width field; the wiki notes ancestral samplers hold the original look less well.
--sd_model MODELCheckpoint for the jobSwitches 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 / SyntaxWhat it doesNotes
--xformersEnable xFormersNVIDIA cards only; in the wiki's test table it is the fastest cross-attention choice with low memory use.
--opt-sdp-attentionScaled dot product attentionCan beat xFormers on some systems but needs more VRAM and gives slightly different results on each run.
--opt-sdp-no-mem-attentionDeterministic SDP attentionRepeatable results, at a little less speed and more VRAM than --opt-sdp-attention.
--medvramMedium VRAM modeKeeps only one of the three model parts in VRAM at a time, saving memory without a large speed loss.
--medvram-sdxlMedium VRAM for SDXL onlyApplies the --medvram behaviour only while an SDXL checkpoint is loaded.
--lowvramLow VRAM modeSplits the UNet further so only one module sits in VRAM; the wiki calls the speed loss devastating.
--upcast-samplingUpcast samplingFirst fix to try on cards without half-precision support; it has no effect when --no-half is also set.
--no-half-vaeFull-precision VAEKeeps the VAE in 32-bit floats; the next fallback for green or black images before the slower --no-half.
--precision fullFull precision evaluationUsed together with --no-half when green or black images persist; the default precision is autocast.
--no-halfFull-precision modelLast resort for half-precision failures: much higher VRAM use, which may in turn require --medvram.
--disable-nan-checkSkip the NaN checkWhen one image of a batch fails with NaNs the others are still shown, which confirms a precision problem.
--use-cpu allRun on the CPUCPU-only runs also need --precision full, --no-half and --skip-torch-cuda-test, and generate very slowly.
--skip-torch-cuda-testSkip the CUDA checkAvoids 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 / SyntaxWhat it doesNotes
COMMANDLINE_ARGSDefault launch argumentsSet it in webui-user.bat with set, or in webui-user.sh with export, so the flags apply on every start.
--listenListen on the networkBinds to 0.0.0.0 so other machines on the local network can open the UI at this computer's address.
--port PORTServer portThe default is 7860 when free; ports below 1024 need root or administrator rights.
--sharePublic Gradio linkGives an xxx.app.gradio address reachable online, meant for Colab; pair it with --gradio-auth to require a login.
--gradio-auth username:passwordUI loginSeveral logins can be separated by commas, and --gradio-auth-path reads them from a file instead.
--apiEnable the APIServes the API alongside the web UI; switch to --nowebui to run the API alone.
--api-auth username:passwordAPI loginRequires a username and password on API requests; give several pairs separated by commas.
--nowebuiAPI without the UIStarts the API server alone; --skip-load-model-at-start then avoids loading a model at launch.
--autolaunchOpen the browser at start
--theme darkForce dark or light themeAccepts light or dark; without it the UI follows the browser's theme.
--ckpt-dir CKPT_DIRCheckpoint folderPoints the checkpoint list at another directory; the wiki's webui-user example keeps models on a separate drive.
--lora-dir LORA_DIRLoRA folderChanges where LoRA files are read from; without it they load from models/Lora.
--embeddings-dir EMBEDDINGS_DIREmbeddings folderMoves the folder that textual inversion embeddings are read from, which defaults to embeddings.
--data-dir DATA_DIRUser data folderBase location for user files; --models-dir can override where models are kept.
--enable-insecure-extension-accessUnlock the Extensions tabExtension installs are blocked when --share, --listen, --ngrok or --server-name is set; this flag allows them anyway.
--disable-all-extensionsStart without extensionsBuilt-in extensions are skipped too; --disable-extra-extensions skips only the ones you installed.
--update-checkCheck for updates at startReports 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

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