Signed-off-by: Vladimir Mandic <mandic00@live.com>
pull/3577/head^2
Vladimir Mandic 2024-11-13 08:07:40 -05:00
parent bea12ee6f2
commit 8654e3e1bd
2 changed files with 14 additions and 6 deletions

View File

@ -45,7 +45,7 @@ class StableDiffusionProcessing:
pag_scale: float = 0.0,
pag_adaptive: float = 0.5,
# styles
styles: List[str] = None,
styles: List[str] = [],
# vae
tiling: bool = False,
full_quality: bool = True,
@ -119,7 +119,10 @@ class StableDiffusionProcessing:
# metadata
extra_generation_params: Dict[Any, Any] = {},
):
# extra args set by processing loop
self.task_args = {}
# state items
self.state: str = ''
self.ops = []
@ -136,6 +139,7 @@ class StableDiffusionProcessing:
self.negative_pooleds = []
self.disable_extra_networks = False
self.iteration = 0
# initializers
self.prompt = prompt
self.seed = seed

View File

@ -255,7 +255,7 @@ class StyleDatabase:
def get_style_prompts(self, styles):
if styles is None:
return []
if styles is not isinstance(styles, list):
if not isinstance(styles, list):
shared.log.error(f'Styles invalid: {styles}')
return []
return [self.find_style(x).prompt for x in styles]
@ -263,7 +263,7 @@ class StyleDatabase:
def get_negative_style_prompts(self, styles):
if styles is None:
return []
if styles is not isinstance(styles, list):
if not isinstance(styles, list):
shared.log.error(f'Styles invalid: {styles}')
return []
return [self.find_style(x).negative_prompt for x in styles]
@ -271,7 +271,7 @@ class StyleDatabase:
def apply_styles_to_prompts(self, prompts, negatives, styles, seeds):
if styles is None:
return prompts, negatives
if styles is not isinstance(styles, list):
if not isinstance(styles, list):
shared.log.error(f'Styles invalid styles: {styles}')
return prompts, negatives
if prompts is None or not isinstance(prompts, list):
@ -294,7 +294,9 @@ class StyleDatabase:
return parsed_positive, parsed_negative
def apply_styles_to_prompt(self, prompt, styles):
if styles is None or not isinstance(styles, list):
if styles is None:
return prompt
if not isinstance(styles, list):
shared.log.error(f'Styles invalid: {styles}')
return prompt
prompt = apply_styles_to_prompt(prompt, [self.find_style(x).prompt for x in styles])
@ -302,7 +304,9 @@ class StyleDatabase:
return prompt
def apply_negative_styles_to_prompt(self, prompt, styles):
if styles is None or not isinstance(styles, list):
if styles is None:
return prompt
if not isinstance(styles, list):
shared.log.error(f'Styles invalid: {styles}')
return prompt
prompt = apply_styles_to_prompt(prompt, [self.find_style(x).negative_prompt for x in styles])