
    bi{              	       \   d dl mZ ddlmZmZ ddlmZ ddlmZm	Z	m
Z
 ddlmZ ddlmZ dd	lmZ  ej"                  e      Z G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z edefdefde
fde	fdefdefg      Z edefdefdefdefg      ZeedZy)   )logging   )AutoPipelineBlocksSequentialPipelineBlocks)InsertableDict   )WanInputStepWanPrepareLatentsStepWanSetTimestepsStep)WanDecodeStep)WanDenoiseStep)WanTextEncoderStepc                   .    e Zd ZeeegZg dZed        Z	y)WanBeforeDenoiseStep)inputset_timestepsprepare_latentsc                      	 y)Na  Before denoise step that prepare the inputs for the denoise step.
This is a sequential pipeline blocks:
 - `WanInputStep` is used to adjust the batch size of the model inputs
 - `WanSetTimestepsStep` is used to set the timesteps
 - `WanPrepareLatentsStep` is used to prepare the latents
 selfs    i/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/diffusers/modular_pipelines/wan/modular_blocks.pydescriptionz WanBeforeDenoiseStep.description(   s    L	
    N)
__name__
__module____qualname__r	   r   r
   block_classesblock_namespropertyr   r   r   r   r   r       s,    M
 @K
 
r   r   c                   .    e Zd ZegZdgZdgZed        Zy)WanAutoBeforeDenoiseSteptext2vidNc                      	 y)NzBefore denoise step that prepare the inputs for the denoise step.
This is an auto pipeline block that works for text2vid.
 - `WanBeforeDenoiseStep` (text2vid) is used.
r   r   s    r   r   z$WanAutoBeforeDenoiseStep.description;       @	
r   )	r   r   r   r   r   r   block_trigger_inputsr    r   r   r   r   r"   r"   4   s/    M ,K 6
 
r   r"   c                   4    e Zd ZegZdgZdgZedefd       Z	y)WanAutoDenoiseStepdenoiseNreturnc                      	 y)NzDenoise step that iteratively denoise the latents. This is a auto pipeline block that works for text2vid tasks.. - `WanDenoiseStep` (denoise) for text2vid tasks.r   r   s    r   r   zWanAutoDenoiseStep.descriptionL   r%   r   )
r   r   r   r   r   r   r&   r    strr   r   r   r   r(   r(   E   s6    M +K 6
S 
 
r   r(   c                   .    e Zd ZegZdgZdgZed        Zy)WanAutoDecodeStepznon-inpaintNc                      y)NzTDecode step that decode the denoised latents into videos outputs.
 - `WanDecodeStep`r   r   s    r   r   zWanAutoDecodeStep.description[   s    fr   )	r   r   r   r   r   r   r&   r    r   r   r   r   r.   r.   V   s,    "OM /K 6g gr   r.   c                   0    e Zd ZeeeegZg dZe	d        Z
y)WanAutoBlocks)text_encoderbefore_denoiser)   decoderc                      	 y)NzvAuto Modular pipeline for text-to-video using Wan.
- for text-to-video generation, all you need to provide is `prompt`r   r   s    r   r   zWanAutoBlocks.descriptiono   s    T	
r   N)r   r   r   r   r"   r(   r.   r   r   r    r   r   r   r   r1   r1   a   s0     	MK 
 
r   r1   r2   r   r   r   r)   decoder3   )
text2videoautoN)utilsr   modular_pipeliner   r   modular_pipeline_utilsr   r3   r	   r
   r   decodersr   r)   r   encodersr   
get_loggerr   loggerr   r"   r(   r.   r1   TEXT2VIDEO_BLOCKSAUTO_BLOCKS
ALL_BLOCKSr   r   r   <module>rC      s    K 3 
 $ # ( 
		H	%
3 
(
1 
"
+ 
"g* g
, 
, #	+,	,	-.	12	N#	=!	  	+,	34	&'	$%	 $
r   