Add additional options and features to hires fix for Stable Diffusion web UI
Hires pass CFG scale
Hires Batch and Seed
Hires prompt mode and Remove First Pass Extra Networks
Default
: Webui default behavior:Append
: Append hires prompt after first pass promptPrepend
: Prepend hires prompt before first pass promptPrompt S/R
: Prompt Search and Replace:Remove First Pass Extra Networks
: When check will remove extra networks from first pass prompt before creating hires promptHires styles
Hires output directory
Settings > Paths for saving > Output directory for hires. fix images
Override "Checkpoint dropdown: use filenames without paths" for other dropdowns
Checkpoint dropdowns
are listed with or without pathsSettings > UI alternatives > Override "Checkpoint dropdown: use filenames without paths" for other dropdowns
Default
: No change With paths (Hires fix)
: Hires fix checkpoint dropdown will be shown with pathsWithout paths (Hires fix)
: Hires fix checkpoint dropdown will be shown without pathsWith paths (Global)
: Most checkpoint dropdown will be shown with pathsWithout paths (Global)
: Most checkpoint dropdown will be shown without paths
Global
variant will affect everything* which can potentially cause issues depending on how the checkpoint value is usedmodules.sd_models.checkpoint_tiles
to get the checkpoint list, which is used in most places in the webuiRemove First Pass Extra Networks
operates by removing all extra networks in prompt (every thin matching <xxxx:extra-network-name:weight>
) in the first pass prompt, this means it only works with LoRA
and Hypernetworks
and dose not work with Textual Inversion Embeddings
or if the extra networks are added by later by other means such as Setting
or Styles
.Hires prompt mode
is Default
and the hires prompt is not blank, as the user input hires prompt will take precedence. hires prompt is not specfied (when blank)
then use the same first pass prompt for hires pass
else use the user input hires prompt
. if the first pass prompt is not use the Remove First Pass Extra Networks
will not have an affect.
Usage case example:
Hires prompt mode
such as Append
to change the extra networks used during hires pass
Note: the
Default
Hires prompt mode has priority overRemove First Pass Extra Networks
, in other words ifDefault
is selectedRemove First Pass Extra Networks
will be ignored if hires prompt is not blank
When in Prompt Search and Replace mode the first pass prompt will be used as the base template to perform a search and replace on to create the hires prompt.
the first pass can be any regular prompt, or you can insert @insert_marker@
anywhere in the prompt to indicate where the hires prompt should be inserted.
the @insert_marker@
will be removed from the prompt before image generation.
example first pass prompt
this is an example prompt @insert_marker@, and replace prompt some more replace with blank prompt,
prompt to
replace can be
multil-ine
like so
the hires prompt is used as instructions for the search and replace
each instruction is entry starts with a key_word
enclosed by @
at the start of the line, everything after this until the next @key_word@
is the replacement or inserted prompt
Example hires prompt (instructions)
@insert_marker@ insert something here
@replace prompt@ replace something here
@replace with blank@
@can be
multil-ine@replacement can
be multi-line
@insert_marker@
exists in the prompt it will perform insert mode insert something here
will be inserted in its place of @insert_marker@
the @insert_marker@
itself will be removed from the prompt
@replace prompt@
dose not in the prompt it will perform replace mode, the prompt will be unchanged but the hires prompt will have replace prompt
replaced with replace something here
@replace with blank@
similar to @replace prompt@
but the replacement is "empty"
, this effectively this removes the replace with blank
from the hires prompt
both search phrase and replacement can be multi-line
if you need a literal @
in the instructions then you can escape it by doubling it @@
you can also change the character used to enclose the key_word
by setting the @
to some other character
This is the resulting using the above prompt and hires prompt resulting prompt
this is an example prompt , and replace prompt some more replace with blank prompt,
prompt to
replace can be
multil-ine
like so
Resulting hires prompt
this is an example prompt insert something here
, and replace something here
some more prompt,
prompt to
replace replacement can
be multi-line
like so
Remove First Pass Extra Networks
and Hires prompt mode
are performed very early in the image generation pipline, even before Styles
is applied to prompts, which means that it will not affect the prompt added by Styles
. it should only affect the style you can visibly see in the prompt input box.Hires pass CFG scale
and Hires Batch and Seed
can be archived by manually performing img2img on the txt2img output.Hires prompt mode
and Remove First Pass Extra Networks
can be archived by manually editing the prompt before generating the hires pass.Hires output directory
can be archived by manually changing the output directory in the webui settings