
    +h&              
          S SK Jr  SSKJrJr  SSKJr  SSKJrJ	r	J
r
JrJr  SSKJr  SSKJr  SS	KJrJr  \R(                  " \5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\" S\4S\
4S\4S\4S\4S\4/5      r\" S\4S\4S\
4S\	4S\4S\4S\4/5      r\" S\4S\4S\4S\4S\4/5      r \\\ S .r!g!)"   )logging   )AutoPipelineBlocksSequentialPipelineBlocks)InsertableDict   )FluxImg2ImgPrepareLatentsStepFluxImg2ImgSetTimestepsStepFluxInputStepFluxPrepareLatentsStepFluxSetTimestepsStep)FluxDecodeStep)FluxDenoiseStep)FluxTextEncoderStepFluxVaeEncoderStepc                   6    \ rS rSr\/rS/rS/r\S 5       r	Sr
g)FluxAutoVaeEncoderStep"   img2imgimagec                      g)Na  Vae encoder step that encode the image inputs into their latent representations.
This is an auto pipeline block that works for img2img tasks.
 - `FluxVaeEncoderStep` (img2img) is used when only `image` is provided. - if `image` is provided, step will be skipped. selfs    i/home/james-whalen/.local/lib/python3.13/site-packages/diffusers/modular_pipelines/flux/modular_blocks.pydescription"FluxAutoVaeEncoderStep.description'   s    A	
    r   N)__name__
__module____qualname____firstlineno__r   block_classesblock_namesblock_trigger_inputspropertyr   __static_attributes__r   r   r   r   r   "   s+    '(M+K#9
 
r   r   c                   6    \ rS rSr\\\/r/ SQr\	S 5       r
Srg)FluxBeforeDenoiseStep2   )inputprepare_latentsset_timestepsc                      g)Na"  Before denoise step that prepare the inputs for the denoise step.
This is a sequential pipeline blocks:
 - `FluxInputStep` is used to adjust the batch size of the model inputs
 - `FluxPrepareLatentsStep` is used to prepare the latents
 - `FluxSetTimestepsStep` is used to set the timesteps
r   r   s    r   r   !FluxBeforeDenoiseStep.description:   s    I	
r   r   N)r   r    r!   r"   r   r   r   r#   r$   r&   r   r'   r   r   r   r)   r)   2   s,    M
 @K
 
r   r)   c                   6    \ rS rSr\\\/r/ SQr\	S 5       r
Srg)FluxImg2ImgBeforeDenoiseStepF   )r+   r-   r,   c                      g)NaA  Before denoise step that prepare the inputs for the denoise step for img2img task.
This is a sequential pipeline blocks:
 - `FluxInputStep` is used to adjust the batch size of the model inputs
 - `FluxImg2ImgSetTimestepsStep` is used to set the timesteps
 - `FluxImg2ImgPrepareLatentsStep` is used to prepare the latents
r   r   s    r   r   (FluxImg2ImgBeforeDenoiseStep.descriptionJ   s    T	
r   r   N)r   r    r!   r"   r   r
   r	   r#   r$   r&   r   r'   r   r   r   r1   r1   F   s'    "$?A^_M?K
 
r   r1   c                   <    \ rS rSr\\/rSS/rSS/r\	S 5       r
Srg)FluxAutoBeforeDenoiseStepV   
text2imager   Nimage_latentsc                      g)Na  Before denoise step that prepare the inputs for the denoise step.
This is an auto pipeline block that works for text2image.
 - `FluxBeforeDenoiseStep` (text2image) is used.
 - `FluxImg2ImgBeforeDenoiseStep` (img2img) is used when only `image_latents` is provided.
r   r   s    r   r   %FluxAutoBeforeDenoiseStep.description[   s    m	
r   r   )r   r    r!   r"   r)   r1   r#   r$   r%   r&   r   r'   r   r   r   r6   r6   V   s4    *,HIM+K /2
 
r   r6   c                   >    \ rS rSr\/rS/rS/r\S\	4S j5       r
Srg)FluxAutoDenoiseStepf   denoiseNreturnc                      g)NzDenoise step that iteratively denoise the latents. This is a auto pipeline block that works for text2image and img2img tasks. - `FluxDenoiseStep` (denoise) for text2image and img2img tasks.r   r   s    r   r   FluxAutoDenoiseStep.descriptionk   s    O	
r   r   )r   r    r!   r"   r   r#   r$   r%   r&   strr   r'   r   r   r   r=   r=   f   s2    $%M+K 6
S 
 
r   r=   c                   6    \ rS rSr\/rS/rS/r\S 5       r	Sr
g)FluxAutoDecodeStepu   znon-inpaintNc                     g)NzTDecode step that decode the denoised latents into image outputs.
 - `FluxDecodeStep`r   r   s    r   r   FluxAutoDecodeStep.descriptionz   s    fr   r   )r   r    r!   r"   r   r#   r$   r%   r&   r   r'   r   r   r   rE   rE   u   s-    #$M /K 6g gr   rE   c                   :    \ rS rSr\\\\\/r	/ SQr
\S 5       rSrg)FluxAutoBlocks   )text_encoderimage_encoderbefore_denoiser?   decoderc                      g)NzAuto Modular pipeline for text-to-image and image-to-image using Flux.
- for text-to-image generation, all you need to provide is `prompt`
- for image-to-image generation, you need to provide either `image` or `image_latents`r   r   s    r   r   FluxAutoBlocks.description   s    g	
r   r   N)r   r    r!   r"   r   r   r6   r=   rE   r#   r$   r&   r   r'   r   r   r   rJ   rJ      s2    !M \K
 
r   rJ   rL   r+   r-   r,   r?   decoderM   rN   )r8   r   autoN)"utilsr   modular_pipeliner   r   modular_pipeline_utilsr   rN   r	   r
   r   r   r   decodersr   r?   r   encodersr   r   
get_loggerr   loggerr   r)   r1   r6   r=   rE   rJ   TEXT2IMAGE_BLOCKSIMAGE2IMAGE_BLOCKSAUTO_BLOCKS
ALL_BLOCKSr   r   r   <module>r_      su    K 3  % $ = 
		H	%
/ 
 
4 
(
#; 
 
 2 
 
, 
g+ g
- 
& #	,-	- 	./	23	O$	>"	  $	,-	,-	- 	56	9:	O$	>"
  	,-	01	45	'(	%& .:LVab
r   