You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this function is used to generate the infotext that is stored in the generated images, it's contains the parameters that are required to generate the imagee
709
+
Args:
710
+
p: StableDiffusionProcessing
711
+
all_prompts: list[str]
712
+
all_seeds: list[int]
713
+
all_subseeds: list[int]
714
+
comments: list[str]
715
+
iteration: int
716
+
position_in_batch: int
717
+
use_main_prompt: bool
718
+
index: int
719
+
all_negative_prompts: list[str]
720
+
721
+
Returns: str
722
+
723
+
Extra generation params
724
+
p.extra_generation_params dictionary allows for additional parameters to be added to the infotext
725
+
this can be use by the base webui or extensions.
726
+
To add a new entry, add a new key value pair, the dictionary key will be used as the key of the parameter in the infotext
727
+
the value generation_params can be defined as:
728
+
- str | None
729
+
- List[str|None]
730
+
- callable func(**kwargs) -> str | None
731
+
732
+
When defined as a string, it will be used as without extra processing; this is this most common use case.
733
+
734
+
Defining as a list allows for parameter that changes across images in the job, for example, the 'Seed' parameter.
735
+
The list should have the same length as the total number of images in the entire job.
736
+
737
+
Defining as a callable function allows parameter cannot be generated earlier or when extra logic is required.
738
+
For example 'Hires prompt', due to reasons the hr_prompt might be changed by process in the pipeline or extensions
739
+
and may vary across different images, defining as a static string or list would not work.
740
+
741
+
The function takes locals() as **kwargs, as such will have access to variables like 'p' and 'index'.
742
+
the base signature of the function should be:
743
+
func(**kwargs) -> str | None
744
+
optionally it can have additional arguments that will be used in the function:
745
+
func(p, index, **kwargs) -> str | None
746
+
note: for better future compatibility even though this function will have access to all variables in the locals(),
747
+
it is recommended to only use the arguments present in the function signature of create_infotext.
748
+
For actual implementation examples, see StableDiffusionProcessingTxt2Img.init > get_hr_prompt.
0 commit comments