2727from  ...utils  import  logging 
2828from  ...utils .torch_utils  import  randn_tensor , unwrap_module 
2929from  ..modular_pipeline  import  (
30-     PipelineBlock ,
30+     ModularPipelineBlocks ,
3131    PipelineState ,
3232)
3333from  ..modular_pipeline_utils  import  ComponentSpec , ConfigSpec , InputParam , OutputParam 
@@ -195,7 +195,7 @@ def prepare_latents_img2img(
195195    return  latents 
196196
197197
198- class  StableDiffusionXLInputStep (PipelineBlock ):
198+ class  StableDiffusionXLInputStep (ModularPipelineBlocks ):
199199    model_name  =  "stable-diffusion-xl" 
200200
201201    @property  
@@ -213,11 +213,6 @@ def description(self) -> str:
213213    def  inputs (self ) ->  List [InputParam ]:
214214        return  [
215215            InputParam ("num_images_per_prompt" , default = 1 ),
216-         ]
217- 
218-     @property  
219-     def  intermediate_inputs (self ) ->  List [str ]:
220-         return  [
221216            InputParam (
222217                "prompt_embeds" ,
223218                required = True ,
@@ -394,7 +389,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
394389        return  components , state 
395390
396391
397- class  StableDiffusionXLImg2ImgSetTimestepsStep (PipelineBlock ):
392+ class  StableDiffusionXLImg2ImgSetTimestepsStep (ModularPipelineBlocks ):
398393    model_name  =  "stable-diffusion-xl" 
399394
400395    @property  
@@ -421,11 +416,6 @@ def inputs(self) -> List[InputParam]:
421416            InputParam ("denoising_start" ),
422417            # YiYi TODO: do we need num_images_per_prompt here? 
423418            InputParam ("num_images_per_prompt" , default = 1 ),
424-         ]
425- 
426-     @property  
427-     def  intermediate_inputs (self ) ->  List [str ]:
428-         return  [
429419            InputParam (
430420                "batch_size" ,
431421                required = True ,
@@ -543,7 +533,7 @@ def denoising_value_valid(dnv):
543533        return  components , state 
544534
545535
546- class  StableDiffusionXLSetTimestepsStep (PipelineBlock ):
536+ class  StableDiffusionXLSetTimestepsStep (ModularPipelineBlocks ):
547537    model_name  =  "stable-diffusion-xl" 
548538
549539    @property  
@@ -611,7 +601,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
611601        return  components , state 
612602
613603
614- class  StableDiffusionXLInpaintPrepareLatentsStep (PipelineBlock ):
604+ class  StableDiffusionXLInpaintPrepareLatentsStep (ModularPipelineBlocks ):
615605    model_name  =  "stable-diffusion-xl" 
616606
617607    @property  
@@ -640,11 +630,6 @@ def inputs(self) -> List[Tuple[str, Any]]:
640630                "`num_inference_steps`. A value of 1, therefore, essentially ignores `image`. Note that in the case of " 
641631                "`denoising_start` being declared as an integer, the value of `strength` will be ignored." ,
642632            ),
643-         ]
644- 
645-     @property  
646-     def  intermediate_inputs (self ) ->  List [str ]:
647-         return  [
648633            InputParam ("generator" ),
649634            InputParam (
650635                "batch_size" ,
@@ -890,7 +875,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
890875        return  components , state 
891876
892877
893- class  StableDiffusionXLImg2ImgPrepareLatentsStep (PipelineBlock ):
878+ class  StableDiffusionXLImg2ImgPrepareLatentsStep (ModularPipelineBlocks ):
894879    model_name  =  "stable-diffusion-xl" 
895880
896881    @property  
@@ -910,11 +895,6 @@ def inputs(self) -> List[Tuple[str, Any]]:
910895            InputParam ("latents" ),
911896            InputParam ("num_images_per_prompt" , default = 1 ),
912897            InputParam ("denoising_start" ),
913-         ]
914- 
915-     @property  
916-     def  intermediate_inputs (self ) ->  List [InputParam ]:
917-         return  [
918898            InputParam ("generator" ),
919899            InputParam (
920900                "latent_timestep" ,
@@ -971,7 +951,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
971951        return  components , state 
972952
973953
974- class  StableDiffusionXLPrepareLatentsStep (PipelineBlock ):
954+ class  StableDiffusionXLPrepareLatentsStep (ModularPipelineBlocks ):
975955    model_name  =  "stable-diffusion-xl" 
976956
977957    @property  
@@ -992,11 +972,6 @@ def inputs(self) -> List[InputParam]:
992972            InputParam ("width" ),
993973            InputParam ("latents" ),
994974            InputParam ("num_images_per_prompt" , default = 1 ),
995-         ]
996- 
997-     @property  
998-     def  intermediate_inputs (self ) ->  List [InputParam ]:
999-         return  [
1000975            InputParam ("generator" ),
1001976            InputParam (
1002977                "batch_size" ,
@@ -1082,7 +1057,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
10821057        return  components , state 
10831058
10841059
1085- class  StableDiffusionXLImg2ImgPrepareAdditionalConditioningStep (PipelineBlock ):
1060+ class  StableDiffusionXLImg2ImgPrepareAdditionalConditioningStep (ModularPipelineBlocks ):
10861061    model_name  =  "stable-diffusion-xl" 
10871062
10881063    @property  
@@ -1119,11 +1094,6 @@ def inputs(self) -> List[Tuple[str, Any]]:
11191094            InputParam ("num_images_per_prompt" , default = 1 ),
11201095            InputParam ("aesthetic_score" , default = 6.0 ),
11211096            InputParam ("negative_aesthetic_score" , default = 2.0 ),
1122-         ]
1123- 
1124-     @property  
1125-     def  intermediate_inputs (self ) ->  List [InputParam ]:
1126-         return  [
11271097            InputParam (
11281098                "latents" ,
11291099                required = True ,
@@ -1306,7 +1276,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
13061276        return  components , state 
13071277
13081278
1309- class  StableDiffusionXLPrepareAdditionalConditioningStep (PipelineBlock ):
1279+ class  StableDiffusionXLPrepareAdditionalConditioningStep (ModularPipelineBlocks ):
13101280    model_name  =  "stable-diffusion-xl" 
13111281
13121282    @property  
@@ -1335,11 +1305,6 @@ def inputs(self) -> List[Tuple[str, Any]]:
13351305            InputParam ("crops_coords_top_left" , default = (0 , 0 )),
13361306            InputParam ("negative_crops_coords_top_left" , default = (0 , 0 )),
13371307            InputParam ("num_images_per_prompt" , default = 1 ),
1338-         ]
1339- 
1340-     @property  
1341-     def  intermediate_inputs (self ) ->  List [InputParam ]:
1342-         return  [
13431308            InputParam (
13441309                "latents" ,
13451310                required = True ,
@@ -1489,7 +1454,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
14891454        return  components , state 
14901455
14911456
1492- class  StableDiffusionXLControlNetInputStep (PipelineBlock ):
1457+ class  StableDiffusionXLControlNetInputStep (ModularPipelineBlocks ):
14931458    model_name  =  "stable-diffusion-xl" 
14941459
14951460    @property  
@@ -1517,11 +1482,6 @@ def inputs(self) -> List[Tuple[str, Any]]:
15171482            InputParam ("controlnet_conditioning_scale" , default = 1.0 ),
15181483            InputParam ("guess_mode" , default = False ),
15191484            InputParam ("num_images_per_prompt" , default = 1 ),
1520-         ]
1521- 
1522-     @property  
1523-     def  intermediate_inputs (self ) ->  List [str ]:
1524-         return  [
15251485            InputParam (
15261486                "latents" ,
15271487                required = True ,
@@ -1708,7 +1668,7 @@ def __call__(self, components: StableDiffusionXLModularPipeline, state: Pipeline
17081668        return  components , state 
17091669
17101670
1711- class  StableDiffusionXLControlNetUnionInputStep (PipelineBlock ):
1671+ class  StableDiffusionXLControlNetUnionInputStep (ModularPipelineBlocks ):
17121672    model_name  =  "stable-diffusion-xl" 
17131673
17141674    @property  
0 commit comments