Skip to content

Commit 8ad14a5

Browse files
committed
make generator intermediates (it is mutable)
1 parent a7fb2d2 commit 8ad14a5

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/diffusers/modular_pipelines/stable_diffusion_xl/before_denoise.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ def description(self) -> str:
440440
@property
441441
def inputs(self) -> List[Tuple[str, Any]]:
442442
return [
443-
InputParam("generator"),
444443
InputParam("latents"),
445444
InputParam("num_images_per_prompt", default=1),
446445
InputParam("denoising_start"),
@@ -459,6 +458,7 @@ def inputs(self) -> List[Tuple[str, Any]]:
459458
@property
460459
def intermediates_inputs(self) -> List[str]:
461460
return [
461+
InputParam("generator"),
462462
InputParam(
463463
"batch_size",
464464
required=True,
@@ -733,7 +733,6 @@ def description(self) -> str:
733733
@property
734734
def inputs(self) -> List[Tuple[str, Any]]:
735735
return [
736-
InputParam("generator"),
737736
InputParam("latents"),
738737
InputParam("num_images_per_prompt", default=1),
739738
InputParam("denoising_start"),
@@ -742,6 +741,7 @@ def inputs(self) -> List[Tuple[str, Any]]:
742741
@property
743742
def intermediates_inputs(self) -> List[InputParam]:
744743
return [
744+
InputParam("generator"),
745745
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."),
746746
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."),
747747
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,14 +879,14 @@ def inputs(self) -> List[InputParam]:
879879
return [
880880
InputParam("height"),
881881
InputParam("width"),
882-
InputParam("generator"),
883882
InputParam("latents"),
884883
InputParam("num_images_per_prompt", default=1),
885884
]
886885

887886
@property
888887
def intermediates_inputs(self) -> List[InputParam]:
889888
return [
889+
InputParam("generator"),
890890
InputParam(
891891
"batch_size",
892892
required=True,

src/diffusers/modular_pipelines/stable_diffusion_xl/denoise.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@ def description(self) -> str:
485485
@property
486486
def inputs(self) -> List[Tuple[str, Any]]:
487487
return [
488-
InputParam("generator"),
489488
InputParam("eta", default=0.0),
490489
]
491490

492491
@property
493492
def intermediates_inputs(self) -> List[str]:
494493
return [
494+
InputParam("generator"),
495495
InputParam(
496496
"latents",
497497
required=True,
@@ -554,13 +554,13 @@ def description(self) -> str:
554554
@property
555555
def inputs(self) -> List[Tuple[str, Any]]:
556556
return [
557-
InputParam("generator"),
558557
InputParam("eta", default=0.0),
559558
]
560559

561560
@property
562561
def intermediates_inputs(self) -> List[str]:
563562
return [
563+
InputParam("generator"),
564564
InputParam(
565565
"timesteps",
566566
required=True,

src/diffusers/modular_pipelines/stable_diffusion_xl/encoders.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,14 +568,14 @@ def expected_components(self) -> List[ComponentSpec]:
568568
def inputs(self) -> List[InputParam]:
569569
return [
570570
InputParam("image", required=True),
571-
InputParam("generator"),
572571
InputParam("height"),
573572
InputParam("width"),
574573
]
575574

576575
@property
577576
def intermediates_inputs(self) -> List[InputParam]:
578577
return [
578+
InputParam("generator"),
579579
InputParam("dtype", type_hint=torch.dtype, description="Data type of model tensor inputs"),
580580
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]")]
581581

@@ -680,15 +680,17 @@ def inputs(self) -> List[InputParam]:
680680
return [
681681
InputParam("height"),
682682
InputParam("width"),
683-
InputParam("generator"),
684683
InputParam("image", required=True),
685684
InputParam("mask_image", required=True),
686685
InputParam("padding_mask_crop"),
687686
]
688687

689688
@property
690689
def intermediates_inputs(self) -> List[InputParam]:
691-
return [InputParam("dtype", type_hint=torch.dtype, description="The dtype of the model inputs")]
690+
return [
691+
InputParam("dtype", type_hint=torch.dtype, description="The dtype of the model inputs"),
692+
InputParam("generator"),
693+
]
692694

693695
@property
694696
def intermediates_outputs(self) -> List[OutputParam]:

0 commit comments

Comments
 (0)