diff --git a/modules/processing_class.py b/modules/processing_class.py index 333e11925..24ec0d8d9 100644 --- a/modules/processing_class.py +++ b/modules/processing_class.py @@ -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 diff --git a/modules/styles.py b/modules/styles.py index a5bfbecfd..0dd48eb7f 100644 --- a/modules/styles.py +++ b/modules/styles.py @@ -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])