1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00

make generator intermediates (it is mutable)

This commit is contained in:
yiyixuxu
2025-05-13 23:25:56 +02:00
parent a7fb2d2a22
commit 8ad14a52cb
3 changed files with 10 additions and 8 deletions

View File

@@ -440,7 +440,6 @@ class StableDiffusionXLInpaintPrepareLatentsStep(PipelineBlock):
@property
def inputs(self) -> List[Tuple[str, Any]]:
return [
InputParam("generator"),
InputParam("latents"),
InputParam("num_images_per_prompt", default=1),
InputParam("denoising_start"),
@@ -459,6 +458,7 @@ class StableDiffusionXLInpaintPrepareLatentsStep(PipelineBlock):
@property
def intermediates_inputs(self) -> List[str]:
return [
InputParam("generator"),
InputParam(
"batch_size",
required=True,
@@ -733,7 +733,6 @@ class StableDiffusionXLImg2ImgPrepareLatentsStep(PipelineBlock):
@property
def inputs(self) -> List[Tuple[str, Any]]:
return [
InputParam("generator"),
InputParam("latents"),
InputParam("num_images_per_prompt", default=1),
InputParam("denoising_start"),
@@ -742,6 +741,7 @@ class StableDiffusionXLImg2ImgPrepareLatentsStep(PipelineBlock):
@property
def intermediates_inputs(self) -> List[InputParam]:
return [
InputParam("generator"),
InputParam("latent_timestep", required=True, type_hint=torch.Tensor, description="The timestep that represents the initial noise level for image-to-image/inpainting generation. Can be generated in set_timesteps step."),
InputParam("image_latents", required=True, type_hint=torch.Tensor, description="The latents representing the reference image for image-to-image/inpainting generation. Can be generated in vae_encode step."),
InputParam("batch_size", required=True, type_hint=int, description="Number of prompts, the final batch size of model inputs should be batch_size * num_images_per_prompt. Can be generated in input step."),
@@ -879,7 +879,6 @@ class StableDiffusionXLPrepareLatentsStep(PipelineBlock):
return [
InputParam("height"),
InputParam("width"),
InputParam("generator"),
InputParam("latents"),
InputParam("num_images_per_prompt", default=1),
]
@@ -887,6 +886,7 @@ class StableDiffusionXLPrepareLatentsStep(PipelineBlock):
@property
def intermediates_inputs(self) -> List[InputParam]:
return [
InputParam("generator"),
InputParam(
"batch_size",
required=True,

View File

@@ -485,13 +485,13 @@ class StableDiffusionXLDenoiseLoopAfterDenoiser(PipelineBlock):
@property
def inputs(self) -> List[Tuple[str, Any]]:
return [
InputParam("generator"),
InputParam("eta", default=0.0),
]
@property
def intermediates_inputs(self) -> List[str]:
return [
InputParam("generator"),
InputParam(
"latents",
required=True,
@@ -554,13 +554,13 @@ class StableDiffusionXLInpaintDenoiseLoopAfterDenoiser(PipelineBlock):
@property
def inputs(self) -> List[Tuple[str, Any]]:
return [
InputParam("generator"),
InputParam("eta", default=0.0),
]
@property
def intermediates_inputs(self) -> List[str]:
return [
InputParam("generator"),
InputParam(
"timesteps",
required=True,

View File

@@ -568,7 +568,6 @@ class StableDiffusionXLVaeEncoderStep(PipelineBlock):
def inputs(self) -> List[InputParam]:
return [
InputParam("image", required=True),
InputParam("generator"),
InputParam("height"),
InputParam("width"),
]
@@ -576,6 +575,7 @@ class StableDiffusionXLVaeEncoderStep(PipelineBlock):
@property
def intermediates_inputs(self) -> List[InputParam]:
return [
InputParam("generator"),
InputParam("dtype", type_hint=torch.dtype, description="Data type of model tensor inputs"),
InputParam("preprocess_kwargs", type_hint=Optional[dict], description="A kwargs dictionary that if specified is passed along to the `ImageProcessor` as defined under `self.image_processor` in [diffusers.image_processor.VaeImageProcessor]")]
@@ -680,7 +680,6 @@ class StableDiffusionXLInpaintVaeEncoderStep(PipelineBlock):
return [
InputParam("height"),
InputParam("width"),
InputParam("generator"),
InputParam("image", required=True),
InputParam("mask_image", required=True),
InputParam("padding_mask_crop"),
@@ -688,7 +687,10 @@ class StableDiffusionXLInpaintVaeEncoderStep(PipelineBlock):
@property
def intermediates_inputs(self) -> List[InputParam]:
return [InputParam("dtype", type_hint=torch.dtype, description="The dtype of the model inputs")]
return [
InputParam("dtype", type_hint=torch.dtype, description="The dtype of the model inputs"),
InputParam("generator"),
]
@property
def intermediates_outputs(self) -> List[OutputParam]: