
    Pi	                     z    d dl mZ d dlmZmZmZ ddddg dddd	d
f	dededededee         dededededefdZdS )    )List)FluxAutoencoderFluxDecoderFluxEncoder         )         r      r   gxz,C?g=U?
resolutionch_inch_outch_basech_multsch_zn_layers_per_resample_blockscale_factorshift_factorreturnc	           	          fd|D             }	t          |||	|||          }
t          ||t          t          |	                    |dz   ||          }t	          || | f|
|          S )a  
    The image autoencoder for all current Flux diffusion models:
    - FLUX.1-dev
    - FLUX.1-schnell
    - FLUX.1-Canny-dev
    - FLUX.1-Depth-dev
    - FLUX.1-Fill-dev

    ch = number of channels (size of the channel dimension)

    Args:
        resolution (int): The height/width of the square input image.
        ch_in (int): The number of channels of the input image.
        ch_out (int): The number of channels of the output image.
        ch_base (int): The base number of channels.
            This gets multiplied by `ch_mult` values to get the number of inner channels during downsampling/upsampling.
        ch_mults (List[int]): The channel multiple per downsample/upsample block.
            This gets multiplied by `ch_base` to get the number of inner channels during downsampling/upsampling.
        ch_z (int): The number of latent channels (dimension of the latent vector `z`).
        n_layers_per_resample_block (int): Number of resnet layers per downsample/upsample block.
        scale_factor (float): Constant for scaling `z`.
        shift_factor (float): Constant for shifting `z`.

    Returns:
        FluxAutoencoder
    c                     g | ]}|z  S  r   ).0multr   s     y/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/torchtune/models/flux/_model_builders.py
<listcomp>z&flux_1_autoencoder.<locals>.<listcomp>0   s    4444$444    )r   r   channelsn_layers_per_down_blockr   r   r
   )r   r   r    n_layers_per_up_blockr   r   )	img_shapeencoderdecoder)r   r   listreversedr   )r   r   r   r   r   r   r   r   r   r    r$   r%   s      `        r   flux_1_autoencoderr(      s    J 54448444H ;!!  G hx(())9A=!!  G *j1   r   N)	typingr   "torchtune.models.flux._autoencoderr   r   r   intfloatr(   r   r   r   <module>r-      s          X X X X X X X X X X &,,'(  > >>> > 	>
 3i> > "%> > > > > > > > >r   