
    +j$              	         d dl mZ d dlmZ d dlmZmZ  G d d          Z G d d          Z G d d	          Z	 G d
 d          Z
 G d d          Z G d dee          Zd-d.dZej        g dej        g dej        g dej        g diZ G d dee          Zg dZg d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 G d( d)e          Z G d* d+e          Zd,S )/    )annotations)Enum)	BaseModelFieldc                      e Zd ZddZd ZdS )	RecraftColorrintgbc                    |||g| _         d S N)color)selfr	   r   r   s       </home/wildlama/comfy/ComfyUI/comfy_api_nodes/apis/recraft.py__init__zRecraftColor.__init__	   s    AY


    c                ,    t          | j                  S )N)rgb)RecraftColorObjectr   r   s    r   create_api_modelzRecraftColor.create_api_model   s    !dj1111r   N)r	   r
   r   r
   r   r
   __name__
__module____qualname__r   r    r   r   r   r      s7           2 2 2 2 2r   r   c                  6    e Zd Zd Zd ZddZd Zd Zdd	Zd
S )RecraftColorChainc                    g | _         d S r   colorsr   s    r   r   zRecraftColorChain.__init__   s    *,r   c                P    t          | j                  dk    r| j        d         S d S )Nr   )lenr"   r   s    r   	get_firstzRecraftColorChain.get_first   s(    t{a;q>!tr   r   r   c                :    | j                             |           d S r   )r"   append)r   r   s     r   addzRecraftColorChain.add   s    5!!!!!r   c                :    | j         sd S d | j         D             }|S )Nc                6    g | ]}|                                 S r   )r   ).0xs     r   
<listcomp>z6RecraftColorChain.create_api_model.<locals>.<listcomp>   s$    @@@qa((**@@@r   r!   )r   
colors_apis     r   r   z"RecraftColorChain.create_api_model   s,    { 	4@@DK@@@
r   c                `    t                      }| j        D ]}|                    |           |S r   )r   r"   r(   )r   cr   s      r   clonezRecraftColorChain.clone"   s4    [ 	 	EEE%LLLLr   otherc                l    |                                  }|j        D ]}|                    |           |S r   )r1   r"   r(   )r   r2   r0   r   s       r   clone_and_mergez!RecraftColorChain.clone_and_merge(   s6    JJLL\ 	 	EEE%LLLLr   N)r   r   )r2   r   )	r   r   r   r   r%   r(   r   r1   r4   r   r   r   r   r      sx        - - -  
" " " "         r   r   c                  "    e Zd Z	 	 ddd	Zd
 ZdS )RecraftControlsNr"   r   background_colorartistic_levelr
   no_textboolc                >    || _         || _        || _        || _        d S r   r"   r7   r8   r9   )r   r"   r7   r8   r9   s        r   r   zRecraftControls.__init__0   s$     0,r   c                0   | j         | j        | j        	| j        d S d }d }| j         r| j                                         }| j        r1| j                                        }|r|                                nd }t          ||| j        | j                  S )Nr<   )r"   r7   r8   r9   r   r%   RecraftControlsObject)r   r.   background_color_apifirst_backgrounds       r   r   z RecraftControls.create_api_model7   s    ;4#8#@TEXE`eieqey4
#; 	85577J  	e#4>>@@JZ#d#3#D#D#F#F#F`d $JI]<@<OY]Yeg g g 	gr   )NNNN)r"   r   r7   r   r8   r
   r9   r:   r   r   r   r   r6   r6   /   sG        [_9=    g g g g gr   r6   c                      e Zd ZdddZdS )	RecraftStyleNstylestrsubstylestyle_idc                @    || _         |dk    rd }|| _        || _        d S NNone)rC   rE   rF   )r   rC   rE   rF   s       r   r   zRecraftStyle.__init__G   s+    
vH  r   )NNN)rC   rD   rE   rD   rF   rD   )r   r   r   r   r   r   r   rB   rB   F   s-        ! ! ! ! ! ! !r   rB   c                      e Zd ZdZdZdZdS )	RecraftIORECRAFT_V3_STYLERECRAFT_COLORRECRAFT_CONTROLSN)r   r   r   STYLEV3COLORCONTROLSr   r   r   rK   rK   O   s         GE!HHHr   rK   c                      e Zd ZdZdZdZdZdS )RecraftStyleV3realistic_imagedigital_illustrationvector_illustrationlogo_rasterN)r   r   r   rT   rU   rV   rW   r   r   r   rS   rS   U   s$        'O1/KKKr   rS   Tstyle_v3rD   return	list[str]c                p    g }|r|                     d           |t                              | g           z   S rH   )r'   dict_recraft_substyles_v3get)rX   include_none	substyless      r   get_v3_substylesr`   ]   s?    I !   044XrBBBBr   )b_and_w
enterpriseevening_lightfaded_nostalgiaforest_life
hard_flashhdrmotion_blurmystic_naturalismnatural_lightnatural_tonesorganic_calmreal_life_glowretro_realismretro_snapshotstudio_portraiturban_dramavillage_realism	warm_folk))2d_art_poster2d_art_poster_2antiquarianbold_fantasy
child_bookchild_bookscover
crosshatchdigital_engravingengraving_colorexpressionismfreehand_detailsgraingrain_20graphic_intensity
hand_drawnhand_drawn_outlinehandmade_3dhard_comicsinfantile_sketchlong_shadowmodern_folk
multicolor	neon_calmnoirnostalgic_pasteloutline_detailspastel_gradientpastel_sketch	pixel_artplasticpop_artpop_renaissanceseamless
street_arttablet_sketch
urban_glowurban_sketchingvanilla_dreamsyoung_adult_bookyoung_adult_book_2)bold_stroke	chemistrycolored_stencilcontour_pop_artcosmicscutout
depressive	editorialemotional_flat	engravinginfographicalline_artline_circuitlinocutmarker_outlinemosaic	naivectorroundish_flatr   segmented_colorssharp_contrastthinvector_photovivid_shapes)emblem_graffitiemblem_pop_artemblem_punkemblem_stampemblem_vintagec                  J    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdS )RecraftImageSize	1024x1024	1365x1024	1024x1365	1536x1024	1024x1536	1820x1024	1024x1820	1024x2048	2048x1024	1434x1024	1024x1434	1024x1280	1280x1024	1024x1707	1707x1024N)r   r   r   res_1024x1024res_1365x1024res_1024x1365res_1536x1024res_1024x1536res_1820x1024res_1024x1820res_1024x2048res_2048x1024res_1434x1024res_1024x1434res_1024x1280res_1280x1024res_1024x1707res_1707x1024r   r   r   r   r      sY        MMMMMMMMMMMMMMMMMr   r   )r   1536x768768x15361280x832832x12801216x896896x12161152x896896x1152832x13441280x896896x12801344x768768x1344)	2048x2048	3072x1536	1536x3072	2560x1664	1664x2560	2432x1792	1792x2432	2304x1792	1792x2304	1664x2688r   r   	2560x1792	1792x2560c                  4    e Zd ZU  edd          Zded<   dS )r   .zIAn array of 3 integer values in range of 0...255 defining RGB Color Modeldescriptionz	list[int]r   N)r   r   r   r   r   __annotations__r   r   r   r   r      s3         U3,wxxxCxxxxxxr   r   c                      e Zd ZU  edd          Zded<    edd          Zded<    edd	          Zd
ed<    edd          Zded<   dS )r>   NzAn array of preferable colorsr   zlist[RecraftColorObject] | Noner"   z-Use given color as a desired background colorzRecraftColorObject | Noner7   zDo not embed text layoutszbool | Noner9   zDefines artistic tone of your image. At a simple level, the person looks straight at the camera in a static and clean style. Dynamic and eccentric levels introduce movement and creativity. The value should be in range [0..5].
int | Noner8   )	r   r   r   r   r"   r   r7   r9   r8   r   r   r   r>   r>     s         .3eDFe.f.f.fFffff27%Jy2z2z2zzzzz 53NOOOGOOOO!&t  :]  "^  "^  "^N  ^  ^  ^  ^  ^  ^r   r>   c                     e Zd ZU  edd          Zded<    edd          Zded	<    edd
          Zded<    edd          Zded<    ed          Z	ded<    edd          Z
ded<    edd          Zded<    edd          Zded<    edd          Zded<    edd          Zded<    edd          Zded<   dS )RecraftImageGenerationRequest.z0The text prompt describing the image to generater   rD   promptNz3The size of the generated image (e.g., "1024x1024")z
str | Nonesizez The number of images to generater
   nz4A text description of undesired elements on an imagenegative_promptmodelzHThe style to apply to the generated image (e.g., "digital_illustration")rC   zJThe substyle to apply to the generated image, depending on the style inputrE   z6A set of custom parameters to tweak generation processzRecraftControlsObject | Nonecontrolsz4Use a previously uploaded style as a reference; UUIDrF   zDefines the difference with the original image, should lie in [0, 1], where 0 means almost identical, and 1 means miserable similarityzfloat | NonestrengthzSeed for video generationr   random_seed)r   r   r   r   r   r   r   r   r   r   rC   rE   r   rF   r   r  r   r   r   r   r   	  s        %)[\\\F\\\\uT/deeeDeeeeU3$FGGGAGGGG"'%:p"q"q"qOqqqqsEd0z{{{E{{{{ 53  A  A  AH  A  A  A  A-2U4E}-~-~-~H~~~~ 53ijjjHjjjj"U4  6~      H        #eD6QRRRKRRRRRRr   r   c                  X    e Zd ZU  edd          Zded<    edd          Zded<   dS )	RecraftReturnedObject.z)Unique identifier for the generated imager   rD   image_idz!URL to access the generated imageurlN)r   r   r   r   r  r   r  r   r   r   r  r    sT         E#+VWWWHWWWWuS&IJJJCJJJJJJr   r  c                      e Zd ZU  edd          Zded<    edd          Zded<    edd	          Zd
ed<    edd          Zded<   dS )RecraftImageGenerationResponse.z.Unix timestamp when the generation was createdr   r
   createdz)Number of credits used for the generationcreditsNz$Array of generated image informationz"list[RecraftReturnedObject] | NonedatazSingle generated imagezRecraftReturnedObject | Noneimage)	r   r   r   r   r  r   r	  r
  r  r   r   r   r  r    s         5*Z[[[G[[[[5*UVVVGVVVV/4uTGm/n/n/nDnnnn*/%BZ*[*[*[E[[[[[[r   r  c                  4    e Zd ZU  edd          Zded<   dS )RecraftCreateStyleRequest.zCrealistic_image, digital_illustration, vector_illustration, or iconr   rD   rC   N)r   r   r   r   rC   r   r   r   r   r  r  #  s3         s(mnnnEnnnnnnr   r  c                  4    e Zd ZU  edd          Zded<   dS )RecraftCreateStyleResponse.zUUID of the created styler   rD   idN)r   r   r   r   r  r   r   r   r   r  r  '  s3         eC%@AAABAAAAAAr   r  N)T)rX   rD   rY   rZ   )
__future__r   enumr   pydanticr   r   r   r   r6   rB   rK   rD   rS   r`   rT   rU   rV   rW   r\   r   RECRAFT_V4_SIZESRECRAFT_V4_PRO_SIZESr   r>   r   r  r  r  r  r   r   r   <module>r     s}   " " " " " "       % % % % % % % %2 2 2 2 2 2 2 2       >g g g g g g g g.! ! ! ! ! ! ! !" " " " " " " "         S$      C C C C C " % % %* ' ** ** **V & ) ) )4  ! ! !wb J         sD      $   "   $y y y y y y y y^ ^ ^ ^ ^I ^ ^ ^S S S S SI S S SK K K K KI K K K
\ \ \ \ \Y \ \ \o o o o o	 o o oB B B B B B B B B Br   