o
    Gi                     @   sr   d dl mZ d dlZd dlmZ ddlmZmZ ddlm	Z	 ddl
mZ eG dd deZG d	d
 d
e	eZdS )    )	dataclassN   )ConfigMixinregister_to_config)
ModelMixin)
BaseOutputc                   @   s    e Zd ZU dZejdB ed< dS )ReduxImageEncoderOutputNimage_embeds)__name__
__module____qualname__r	   torchTensor__annotations__ r   r   Z/home/ubuntu/.local/lib/python3.10/site-packages/diffusers/pipelines/flux/modeling_flux.pyr      s   
 r   c                       sH   e Zd Ze		ddededdf fddZd	ejdefd
dZ	  Z
S )ReduxImageEncoder     	redux_dimtxt_in_featuresreturnNc                    s2   t    t||d | _t|d || _d S )Nr   )super__init__nnLinearredux_up
redux_down)selfr   r   	__class__r   r   r       s   
zReduxImageEncoder.__init__xc                 C   s"   |  tj| |}t|dS )N)r	   )r   r   
functionalsilur   r   )r   r!   projected_xr   r   r   forward+   s   
zReduxImageEncoder.forward)r   r   )r
   r   r   r   intr   r   r   r   r%   __classcell__r   r   r   r   r      s    
r   )dataclassesr   r   torch.nnr   configuration_utilsr   r   models.modeling_utilsr   utilsr   r   r   r   r   r   r   <module>   s   