mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
web server: update image_progress callback for diffusers data
This commit is contained in:
parent
1e98f4bafc
commit
05a1d68ef4
@ -19,6 +19,7 @@ from uuid import uuid4
|
||||
from threading import Event
|
||||
|
||||
from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash
|
||||
from ldm.invoke.generator.diffusers_pipeline import PipelineIntermediateState
|
||||
from ldm.invoke.pngwriter import PngWriter, retrieve_metadata
|
||||
from ldm.invoke.prompt_parser import split_weighted_subprompts
|
||||
from ldm.invoke.generator.inpaint import infill_methods
|
||||
@ -847,7 +848,9 @@ class InvokeAIWebServer:
|
||||
init_img_path = self.get_image_path_from_url(init_img_url)
|
||||
generation_parameters["init_img"] = Image.open(init_img_path).convert('RGB')
|
||||
|
||||
def image_progress(sample, step):
|
||||
def image_progress(progress_state: PipelineIntermediateState):
|
||||
step = progress_state.step
|
||||
sample = progress_state.latents
|
||||
if self.canceled.is_set():
|
||||
raise CanceledException
|
||||
|
||||
|
@ -188,7 +188,7 @@ class StableDiffusionGeneratorPipeline(DiffusionPipeline):
|
||||
result = None
|
||||
for result in self.generate_from_embeddings(
|
||||
latents, text_embeddings, guidance_scale, run_id, **extra_step_kwargs):
|
||||
if callback is not None:
|
||||
if callback is not None and isinstance(result, PipelineIntermediateState):
|
||||
callback(result)
|
||||
if result is None:
|
||||
raise AssertionError("why was that an empty generator?")
|
||||
|
Loading…
Reference in New Issue
Block a user