34
34
logger = logging .get_logger (__name__ ) # pylint: disable=invalid-name
35
35
36
36
37
- class WanLoopBeforeDenoiser (PipelineBlock ):
38
- model_name = "wan"
39
-
40
- @property
41
- def expected_components (self ) -> List [ComponentSpec ]:
42
- return [
43
- ComponentSpec ("scheduler" , UniPCMultistepScheduler ),
44
- ]
45
-
46
- @property
47
- def description (self ) -> str :
48
- return (
49
- "step within the denoising loop that prepare the latent input for the denoiser. "
50
- "This block should be used to compose the `sub_blocks` attribute of a `LoopSequentialPipelineBlocks` "
51
- "object (e.g. `WanDenoiseLoopWrapper`)"
52
- )
53
-
54
- @property
55
- def intermediate_inputs (self ) -> List [str ]:
56
- return [
57
- InputParam (
58
- "latents" ,
59
- required = True ,
60
- type_hint = torch .Tensor ,
61
- description = "The initial latents to use for the denoising process. Can be generated in prepare_latent step." ,
62
- ),
63
- ]
64
-
65
- @torch .no_grad ()
66
- def __call__ (self , components : WanModularPipeline , block_state : BlockState , i : int , t : int ):
67
- return components , block_state
68
-
69
-
70
37
class WanLoopDenoiser (PipelineBlock ):
71
38
model_name = "wan"
72
39
@@ -99,6 +66,12 @@ def inputs(self) -> List[Tuple[str, Any]]:
99
66
@property
100
67
def intermediate_inputs (self ) -> List [str ]:
101
68
return [
69
+ InputParam (
70
+ "latents" ,
71
+ required = True ,
72
+ type_hint = torch .Tensor ,
73
+ description = "The initial latents to use for the denoising process. Can be generated in prepare_latent step." ,
74
+ ),
102
75
InputParam (
103
76
"num_inference_steps" ,
104
77
required = True ,
@@ -271,7 +244,6 @@ def __call__(self, components: WanModularPipeline, state: PipelineState) -> Pipe
271
244
272
245
class WanDenoiseStep (WanDenoiseLoopWrapper ):
273
246
block_classes = [
274
- WanLoopBeforeDenoiser ,
275
247
WanLoopDenoiser ,
276
248
WanLoopAfterDenoiser ,
277
249
]
@@ -283,7 +255,6 @@ def description(self) -> str:
283
255
"Denoise step that iteratively denoise the latents. \n "
284
256
"Its loop logic is defined in `WanDenoiseLoopWrapper.__call__` method \n "
285
257
"At each iteration, it runs blocks defined in `sub_blocks` sequencially:\n "
286
- " - `WanLoopBeforeDenoiser`\n "
287
258
" - `WanLoopDenoiser`\n "
288
259
" - `WanLoopAfterDenoiser`\n "
289
260
"This block supports both text2vid tasks."
0 commit comments