Skip to content

Commit

Permalink
Add option to disable auto-preview on canvas #201
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Dec 10, 2023
1 parent 9172011 commit 54f087c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ai_diffusion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def handle_message(self, message: ClientMessage):
self.jobs.notify_finished(job)
if job.kind is not JobKind.diffusion:
self.jobs.remove(job)
elif job.kind is JobKind.diffusion and self._layer is None and job.id:
elif settings.auto_preview and self._layer is None and job.id:
self.jobs.select(job.id, 0)
elif message.event is ClientEvent.interrupted:
job.state = JobState.cancelled
Expand Down
5 changes: 5 additions & 0 deletions ai_diffusion/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ class Settings(QObject):
"Negative Prompt", False, "Show text editor to describe things to avoid"
)

auto_preview: bool
_auto_preview = Setting(
"Auto Preview", True, "Automatically preview the first generated result on the canvas"
)

show_control_end: bool
_show_control_end = Setting("Control ending step", False, "Show control ending step ratio")

Expand Down
1 change: 1 addition & 0 deletions ai_diffusion/ui/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,7 @@ def __init__(self):
self.add("prompt_line_count", SpinBoxSetting(S._prompt_line_count, self, 1, 10))
self.add("show_negative_prompt", CheckBoxSetting(S._show_negative_prompt, "Show", self))
self.add("show_control_end", CheckBoxSetting(S._show_control_end, "Show", self))
self.add("auto_preview", CheckBoxSetting(S._auto_preview, "Enable", self))

self._layout.addStretch()

Expand Down

0 comments on commit 54f087c

Please sign in to comment.