o
    i|,                     @   s  d dl mZ d dlmZmZmZmZmZ d dlmZ d dl	m
Z
mZmZmZ G dd de
ZG dd de
ZG d	d
 d
e
ZG dd deeeef  ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd dee ZG dd de
ZG dd de
ZG dd deeZG dd de
ZG dd  d eeZG d!d" d"eeZG d#d$ d$e
ZG d%d& d&e
ZG d'd( d(e
Z G d)d* d*eeZ!G d+d, d,eeZ"G d-d. d.eeZ#G d/d0 d0e
Z$G d1d2 d2e
Z%d3S )4    )Enum)OptionalListDictAnyUnion)datetime)	BaseModelField	RootModelStrictBytesc                   @   "   e Zd ZU edddZeed< dS )IdeogramColorPalette1.z Name of the preset color palettedescriptionnameN__name__
__module____qualname__r
   r   str__annotations__ r   r   ;/mnt/c/Users/fbmor/ComfyUI/comfy_api_nodes/apis/ideogram.pyr         
 r   c                   @   sD   e Zd ZU eddddZee ed< eddddd	Zee	 ed
< dS )MemberNzHexadecimal color codez^#[0-9A-Fa-f]{6}$)r   patterncolorz#Optional weight for the color (0-1)g        g      ?r   geleweight)
r   r   r   r
   r   r   r   r   r!   floatr   r   r   r   r      s   
 r   c                   @   s&   e Zd ZU edddZee ed< dS )IdeogramColorPalette2.z0Array of color definitions with optional weightsr   membersN)r   r   r   r
   r$   r   r   r   r   r   r   r   r#      s   
 r#   c                   @   s*   e Zd ZU edddZeeef ed< dS )IdeogramColorPalette.zjA color palette specification that can either use a preset name or explicit color definitions with weightsr   rootN)	r   r   r   r
   r&   r   r   r#   r   r   r   r   r   r%      s
   
 r%   c                   @   s  e Zd ZU edddZee ed< edddZee	ee
f  ed< edddZee ed< ed	d
dZeed< edddZee ed< edddddZee ed< ed	ddZeed< edddZee ed< edddddZee ed< edddZee ed< dS )ImageRequestNzOptional. The aspect ratio (e.g., 'ASPECT_16_9', 'ASPECT_1_1'). Cannot be used with resolution. Defaults to 'ASPECT_1_1' if unspecified.r   aspect_ratioz8Optional. Color palette object. Only for V_2, V_2_TURBO.color_palettez2Optional. MagicPrompt usage ('AUTO', 'ON', 'OFF').magic_prompt_option.z*The model used (e.g., 'V_2', 'V_2A_TURBO')modelzROptional. Description of what to exclude. Only for V_1, V_1_TURBO, V_2, V_2_TURBO.negative_prompt   z<Optional. Number of images to generate (1-8). Defaults to 1.   r   
num_imagesz2Required. The prompt to use to generate the image.promptzjOptional. Resolution (e.g., 'RESOLUTION_1024_1024'). Only for model V_2. Cannot be used with aspect_ratio.
resolutionz,Optional. A number between 0 and 2147483647.r   seedzuOptional. Style type ('AUTO', 'GENERAL', 'REALISTIC', 'DESIGN', 'RENDER_3D', 'ANIME'). Only for models V_2 and above.
style_type)r   r   r   r
   r(   r   r   r   r)   r   r   r*   r+   r,   r/   intr0   r1   r3   r4   r   r   r   r   r'   $   sN   
 r'   c                   @   r   )IdeogramGenerateRequest.z(The image generation request parameters.r   image_requestN)r   r   r   r
   r7   r'   r   r   r   r   r   r6   M   s   
 r6   c                   @   s   e Zd ZU edddZee ed< edddZee	 ed< edddZ
ee	 ed< edd	dZee ed
< edddZee	 ed< edddZee	 ed< dS )DatumNz/Indicates whether the image is considered safe.r   is_image_safez'The prompt used to generate this image.r0   z:The resolution of the generated image (e.g., '1024x1024').r1   z(The seed value used for this generation.r3   z@The style type used for generation (e.g., 'REALISTIC', 'ANIME').r4   zURL to the generated image.url)r   r   r   r
   r9   r   boolr   r0   r   r1   r3   r5   r4   r:   r   r   r   r   r8   S   s$   
 r8   c                   @   sB   e Zd ZU edddZee ed< edddZee	e
  ed< dS )IdeogramGenerateResponseNz*Timestamp when the generation was created.r   createdz%Array of generated image information.data)r   r   r   r
   r=   r   r   r   r>   r   r8   r   r   r   r   r<   g   s   
 r<   c                   @   r   )	StyleCode.z^[0-9A-Fa-f]{8}$)r   r&   N)r   r   r   r
   r&   r   r   r   r   r   r   r?   p   r   r?   c                   @   sn   e Zd ZU dZee ed< dZee ed< dZ	ee ed< dZ
ee ed< dZee ed< dZee ed< dS )Datum1Nr9   r0   r1   r3   r4   r:   )r   r   r   r9   r   r;   r   r0   r   r1   r3   r5   r4   r:   r   r   r   r   r@   t   s   
 r@   c                   @   s2   e Zd ZU dZee ed< dZeee	  ed< dS )IdeogramV3IdeogramResponseNr=   r>   )
r   r   r   r=   r   r   r   r>   r   r@   r   r   r   r   rA   }   s   
 rA   c                   @      e Zd ZdZdZdZdS )RenderingSpeed1TURBODEFAULTQUALITYN)r   r   r   rD   rE   rF   r   r   r   r   rC          rC   c                   @   s   e Zd ZU dZeeeef  ed< dZ	ee
 ed< eddddZee ed< dZee ed< eed	< edd
ddZee ed< dZeee  ed< dZeee
  ed< dS )IdeogramV3ReframeRequestNr)   imager-   r.   r   r    r/   rendering_speedr1   r   r2   r3   style_codesstyle_reference_images)r   r   r   r)   r   r   r   r   r   rI   r   r
   r/   r5   rK   rC   r3   rL   r   rM   r   r   r   r   rH      s   
 rH   c                   @   rB   )MagicPromptAUTOONOFFN)r   r   r   rO   rP   rQ   r   r   r   r   rN      rG   rN   c                   @   s   e Zd ZdZdZdZdZdS )	StyleTyperO   GENERAL	REALISTICDESIGNN)r   r   r   rO   rS   rT   rU   r   r   r   r   rR      s
    rR   c                   @   s  e Zd ZU dZee ed< dZeeee	f  ed< dZ
ee ed< eddddZee ed	< dZee ed
< dZee ed< eddddZee ed< eed< dZee ed< dZee ed< eddddZee ed< dZeee  ed< dZeee  ed< dZee ed< dS )IdeogramV3RemixRequestNr(   r)   rI   2   r-   d   rJ   image_weightmagic_promptr,   r.   r/   r0   rK   r1   r   r2   r3   rL   rM   r4   )r   r   r   r(   r   r   r   r)   r   r   rI   r   r
   rY   r5   rZ   rN   r,   r/   rK   rC   r1   r3   rL   r   rM   r4   rR   r   r   r   r   rV      s   
 rV   c                   @   s   e Zd ZU dZeeeef  ed< dZ	ee
 ed< dZee ed< eddddZee ed< eed	< dZee ed
< eddddZee ed< dZeee  ed< dZeee
  ed< dS )"IdeogramV3ReplaceBackgroundRequestNr)   rI   rZ   r-   r.   rJ   r/   r0   rK   r   r2   r3   rL   rM   )r   r   r   r)   r   r   r   r   r   rI   r   rZ   rN   r
   r/   r5   rK   rC   r3   rL   r   rM   r   r   r   r   r[      s   
 r[   c                   @   s&   e Zd ZU edddgdZeed< dS )ColorPalette.zName of the color palettePASTELr   examplesr   Nr   r   r   r   r   r\      s   
 r\   c                   @   s   e Zd ZdZdZdS )MagicPrompt2rP   rQ   N)r   r   r   rP   rQ   r   r   r   r   r`      s    r`   c                   @   s    e Zd ZdZdZdZdZdZdS )
StyleType1rO   rS   rT   rU   FICTIONN)r   r   r   rO   rS   rT   rU   rb   r   r   r   r   ra      s    ra   c                   @   rB   )RenderingSpeedrE   rD   rF   N)r   r   r   rE   rD   rF   r   r   r   r   rc      rG   rc   c                   @   s"  e Zd ZU dZee ed< edddZee	 ed< edddZ
ee ed< edddZee	 ed	< edd
dZee ed< edddZeed< eed< edddZee ed< edddZeee  ed< edddZeee	  ed< edddZeee  ed< edddZeee  ed< dS )IdeogramV3EditRequestNr)   zcThe image being edited (max size 10MB); only JPEG, WebP and PNG formats are supported at this time.r   rI   zIDetermine if MagicPrompt should be used in generating the request or not.rZ   zA black and white image of the same size as the image being edited (max size 10MB). Black regions in the mask should match up with the regions of the image that you would like to edit; only JPEG, WebP and PNG formats are supported at this time.maskz!The number of images to generate.r/   .z.The prompt used to describe the edited result.r0   rK   z-Random seed. Set for reproducible generation.r3   zA list of 8 character hexadecimal codes representing the style of the image. Cannot be used in conjunction with style_reference_images or style_type.rL   zA set of images to use as style references (maximum total size 10MB across all style references). The images should be in JPEG, PNG or WebP format.rM   %  Generations with character reference are subject to the character reference pricing. A set of images to use as character references (maximum total size 10MB across all character references), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format.character_reference_images  Optional masks for character reference images. When provided, must match the number of character_reference_images. Each mask should be a grayscale image of the same dimensions as the corresponding character reference image. The images should be in JPEG, PNG or WebP format.character_reference_images_mask)r   r   r   r)   r   r%   r   r
   rI   r   rZ   r   re   r/   r5   r0   rc   r3   rL   r   r?   rM   rg   ri   r   r   r   r   rd      sP   
 rd   c                   @   s\  e Zd ZU edddgdZee ed< dZee	 ed< edddZ
ee ed	< edd
dZee ed< eddddZee ed< edddZeed< eed< edddgdZee ed< edddZee ed< edddZeee  ed< edddZeee  ed< edddZee ed< edddZeee  ed < edd!dZeee  ed"< dS )#IdeogramV3RequestNzAspect ratio in format WxH1x3r^   r(   r)   z*Whether to enable magic prompt enhancementr   rZ   z6Text prompt specifying what to avoid in the generationr,   zNumber of images to generater-   )r   r   r/   .z$The text prompt for image generationr0   rK   zImage resolution in format WxH1280x800r1   z&Seed value for reproducible generationr3   z*Array of style codes in hexadecimal formatrL   z,Array of reference image URLs or identifiersrM   zThe type of style to applyr4   rf   rg   rh   ri   )r   r   r   r
   r(   r   r   r   r)   r\   rZ   r`   r,   r/   r5   r0   rc   r1   r3   rL   r   r?   rM   r4   ra   rg   ri   r   r   r   r   rj      sN   
 rj   N)&enumr   typingr   r   r   r   r   r   pydanticr	   r
   r   r   r   r   r#   r%   r'   r6   r8   r<   r   r?   r@   rA   rC   rH   rN   rR   rV   r[   r\   r`   ra   rc   rd   rj   r   r   r   r   <module>   s:    	
	)		*