mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-30 04:11:15 -08:00
make live preview display work independently from progress bar
This commit is contained in:
parent
499cef3c2b
commit
a0d721e109
2 changed files with 20 additions and 11 deletions
|
|
@ -48,6 +48,7 @@ def add_task_to_queue(id_job):
|
|||
class ProgressRequest(BaseModel):
|
||||
id_task: str = Field(default=None, title="Task ID", description="id of the task to get progress for")
|
||||
id_live_preview: int = Field(default=-1, title="Live preview image ID", description="id of last received last preview image")
|
||||
live_preview: bool = Field(default=True, title="Include live preview", description="boolean flag indicating whether to include the live preview image")
|
||||
|
||||
|
||||
class ProgressResponse(BaseModel):
|
||||
|
|
@ -91,7 +92,7 @@ def progressapi(req: ProgressRequest):
|
|||
|
||||
id_live_preview = req.id_live_preview
|
||||
shared.state.set_current_image()
|
||||
if opts.live_previews_enable and shared.state.id_live_preview != req.id_live_preview:
|
||||
if opts.live_previews_enable and req.live_preview and shared.state.id_live_preview != req.id_live_preview:
|
||||
image = shared.state.current_image
|
||||
if image is not None:
|
||||
buffered = io.BytesIO()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue