diff --git a/ai_diffusion/model.py b/ai_diffusion/model.py index e346a55da..eccbd4a16 100644 --- a/ai_diffusion/model.py +++ b/ai_diffusion/model.py @@ -44,8 +44,8 @@ class Model(QObject, metaclass=PropertyMeta): negative_prompt = Property("") control: ControlLayerList strength = Property(1.0) - upscale: UpscaleWorkspace - live: LiveWorkspace + upscale: "UpscaleWorkspace" + live: "LiveWorkspace" progress = Property(0.0) jobs: JobQueue error = Property("") @@ -446,6 +446,8 @@ def copy_result_to_layer(self): assert self.result is not None and self._result_bounds is not None doc = self._model.document doc.insert_layer(f"[Live] {self._model.prompt}", self.result, self._result_bounds) + if settings.new_seed_after_apply: + self.generate_seed() @property def result(self): diff --git a/ai_diffusion/settings.py b/ai_diffusion/settings.py index cc76269ba..f7280da7d 100644 --- a/ai_diffusion/settings.py +++ b/ai_diffusion/settings.py @@ -115,6 +115,13 @@ class Settings(QObject): "Random Seed", "0", "Random number to produce different results with each generation" ) + new_seed_after_apply: bool + _new_seed_after_apply = Setting( + "Live: New Seed after Apply", + False, + "Pick a new seed after copying the result to the canvas in Live mode", + ) + prompt_line_count: int _prompt_line_count = Setting( "Prompt Line Count", 2, "Size of the text editor for image descriptions" diff --git a/ai_diffusion/ui/settings.py b/ai_diffusion/ui/settings.py index 97f56510f..c4bd94e9d 100644 --- a/ai_diffusion/ui/settings.py +++ b/ai_diffusion/ui/settings.py @@ -979,7 +979,8 @@ def __init__(self): "show_negative_prompt", SwitchSetting(S._show_negative_prompt, ("Show", "Hide"), self) ) self.add("show_control_end", SwitchSetting(S._show_control_end, ("Show", "Hide"), self)) - self.add("auto_preview", SwitchSetting(S._auto_preview, ("On", "Off"), self)) + self.add("auto_preview", SwitchSetting(S._auto_preview, parent=self)) + self.add("new_seed_after_apply", SwitchSetting(S._new_seed_after_apply, parent=self)) self._layout.addStretch()