vertexai/gemini-2.5-flash-image에 대한 API 레퍼런스입니다. Google의 Comfy Router에서 제공합니다.
빠른 시작
Comfy 워크스페이스에서 키를 생성하고COMFY_API_KEY로 내보내세요. Python 및 TypeScript 스니펫은 Comfy SDK(pip install comfy-sdk, npm install @comfyorg/sdk)를 사용하며, cURL 스니펫은 동일한 호출을 raw HTTP로 수행한 것입니다.
모델 ID: vertexai/gemini-2.5-flash-image
엔드포인트: POST https://api.comfy.org/v2/models/vertexai/gemini-2.5-flash-image
- Wait for the result
- Queue and collect later
Schema
Input
object[]
필수
The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history and the latest request.
object[]
필수
object
URI based data.
string
URI
string
The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.Possible values:
application/pdf, audio/mpeg, audio/mp3, audio/wav, image/png, image/jpeg, image/webp, text/plain, video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/flv, image/heic, image/heif, audio/flac, video/webmobject
Inline data in raw bytes. For gemini-2.0-flash-lite and gemini-2.0-flash, you can specify up to 3000 images by using inlineData.
string (byte)
The base64 encoding of the image, PDF, or video to include inline in the prompt. When including media inline, you must also specify the media type (mimeType) of the data. Size limit: 20MBFormat:
bytestring
The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.Possible values:
application/pdf, audio/mpeg, audio/mp3, audio/wav, image/png, image/jpeg, image/webp, text/plain, video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/flv, image/heic, image/heif, audio/flac, video/webmstring
모델이 이 파트의 동영상을 읽는 방식입니다. “AGENTIC”으로 설정하면 고정 비율 프레임 샘플링 대신 모델이 검사할 세그먼트를 결정합니다. 기본 고정 비율 샘플링을 사용하려면 생략합니다. gemini-3.7-flash 이상의 Flash 모델에서 지원됩니다.
string
A text prompt or code snippet.
boolean
Indicates this part is a thinking/reasoning step from the model.
string
Possible values:
user, modelobject
Sampling, length and output settings for the generation. Every field is optional: the fields below that declare a
default apply it when omitted, and the rest fall back to the model’s own behaviour.object
Configuration for image generation
string
Aspect ratio for generated images
object
Optional. The image output format for generated images.
integer
Optional. The compression quality of the output image.
string
Optional. The image format that the output should be saved as.
string
Optional. Specifies the size of generated images. Supported values are 1K, 2K, 4K. If not specified, the model will use default value 1K.
integer
Maximum number of tokens that can be generated in the response. A token is approximately 4 characters. 100 tokens correspond to roughly 60-80 words.Range:
16 to 65536`TEXT`, `IMAGE`[]
integer
When seed is fixed to a specific value, the model makes a best effort to provide the same response for repeated requests. Deterministic output isn’t guaranteed. Also, changing the model or parameter settings, such as the temperature, can cause variations in the response even when you use the same seed value. By default, a random seed value is used. Available for the following models:, gemini-2.5-flash, gemini-2.5-pro, gemini-2.5-flash-preview-04-1, gemini-2.5-pro-preview-05-0, gemini-2.0-flash-lite-00, gemini-2.0-flash-001
string[]
number
기본값:"1"
The temperature is used for sampling during response generation, which occurs when topP and topK are applied. Temperature controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results. A temperature of 0 means that the highest probability tokens are always selected. In this case, responses for a given prompt are mostly deterministic, but a small amount of variation is still possible. If the model returns a response that’s too generic, too short, or the model gives a fallback response, try increasing the temperatureRange:
0 to 2Format: floatobject
Optional. Configuration for thinking features. Thinking is a process where the model breaks down a complex task into smaller steps to generate a higher-quality response.
boolean
Optional. If true, the model will include its thoughts in the response.
integer
Optional. The token budget for the model’s thinking process. The model will make a best effort to stay within this budget.
string
Optional. The thinking level for the model.Possible values:
THINKING_LEVEL_UNSPECIFIED, LOW, MEDIUM, HIGH, MINIMALinteger
기본값:"40"
Top-K changes how the model selects tokens for output. A top-K of 1 means the next selected token is the most probable among all tokens in the model’s vocabulary. A top-K of 3 means that the next token is selected from among the 3 most probable tokens by using temperature.Range:
1 to …number
기본값:"0.95"
If specified, nucleus sampling is used.
Top-P changes how the model selects tokens for output. Tokens are selected from the most (see top-K) to least probable until the sum of their probabilities equals the top-P value. For example, if tokens A, B, and C have a probability of 0.3, 0.2, and 0.1 and the top-P value is 0.5, then the model will select either A or B as the next token by using temperature and excludes C as a candidate.
Specify a lower value for less random responses and a higher value for more random responses.Range:
0 to 1Format: floatobject[]
Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
string
필수
Possible values:
HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_DANGEROUS_CONTENTstring
필수
Possible values:
OFF, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGHobject
Instructions for the model to steer it toward better performance. For example, “Answer as concisely as possible” or “Don’t use technical terms in your response”. The text strings count toward the token limit. The role field of systemInstruction is ignored and doesn’t affect the performance of the model. Note: Only text should be used in parts and content in each part should be in a separate paragraph.
object[]
필수
A list of ordered parts that make up a single message. Different parts may have different IANA MIME types. For limits on the inputs, such as the maximum number of tokens or the number of images, see the model specifications on the Google models page.
string
A text prompt or code snippet.
string
The identity of the entity that creates the message. The following values are supported: user: This indicates that the message is sent by a real person, typically a user-generated message. model: This indicates that the message is generated by the model. The model value is used to insert messages from the model into the conversation during multi-turn conversations. For non-multi-turn conversations, this field can be left blank or unset.Possible values:
user, modelobject[]
A piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. See Function calling.
object[]
string
string
필수
object
JSON schema for the function parameters
boolean
If true, generated images will be uploaded to cloud storage and returned as signed URLs instead of inline base64 data. The URLs expire after 24 hours.
object
For video input, the start and end offset of the video in Duration format. For example, to specify a 10 second clip starting at 1:00, set “startOffset”: { “seconds”: 60 } and “endOffset”: { “seconds”: 70 }. The metadata should only be specified while the video data is presented in inlineData or fileData.
object
Represents a duration offset for video timeline positions.
integer
Signed fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values.Range:
0 to 999999999integer
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive.Range:
-315576000000 to 315576000000object
Represents a duration offset for video timeline positions.
integer
Signed fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values.Range:
0 to 999999999integer
Signed seconds of the span of time. Must be from -315,576,000,000 to +315,576,000,000 inclusive.Range:
-315576000000 to 315576000000GET /v2/models/vertexai/gemini-2.5-flash-image/openapi.json, the same document it validates a call against before the request reaches the provider.
Output
object[]
object
object[]
string[]
integer
string
string (date)
Format:
dateinteger
string
string
object
The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history and the latest request.
object[]
필수
object
URI based data.
string
URI
string
The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.Possible values:
application/pdf, audio/mpeg, audio/mp3, audio/wav, image/png, image/jpeg, image/webp, text/plain, video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/flv, image/heic, image/heif, audio/flac, video/webmobject
Inline data in raw bytes. For gemini-2.0-flash-lite and gemini-2.0-flash, you can specify up to 3000 images by using inlineData.
string (byte)
The base64 encoding of the image, PDF, or video to include inline in the prompt. When including media inline, you must also specify the media type (mimeType) of the data. Size limit: 20MBFormat:
bytestring
The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.Possible values:
application/pdf, audio/mpeg, audio/mp3, audio/wav, image/png, image/jpeg, image/webp, text/plain, video/mov, video/mpeg, video/mp4, video/mpg, video/avi, video/wmv, video/mpegps, video/flv, image/heic, image/heif, audio/flac, video/webmstring
모델이 이 파트의 동영상을 읽는 방식입니다. “AGENTIC”으로 설정하면 고정 비율 프레임 샘플링 대신 모델이 검사할 세그먼트를 결정합니다. 기본 고정 비율 샘플링을 사용하려면 생략합니다. gemini-3.7-flash 이상의 Flash 모델에서 지원됩니다.
string
A text prompt or code snippet.
boolean
Indicates this part is a thinking/reasoning step from the model.
string
Possible values:
user, modelstring
object[]
string
Possible values:
HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_DANGEROUS_CONTENTstring
The probability that the content violates the specified safety categoryPossible values:
NEGLIGIBLE, LOW, MEDIUM, HIGH, UNKNOWNstring
Timestamp when the response was created.
string
The model version used to generate the response.
object
string
string
object[]
string
Possible values:
HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_DANGEROUS_CONTENTstring
The probability that the content violates the specified safety categoryPossible values:
NEGLIGIBLE, LOW, MEDIUM, HIGH, UNKNOWNstring
Unique identifier for the response.
object
integer
Output only. Number of tokens in the cached part in the input (the cached content).
integer
Number of tokens in the response(s).
object[]
Breakdown of candidate tokens by modality.
string
Type of input or output content modality.Possible values:
MODALITY_UNSPECIFIED, TEXT, IMAGE, VIDEO, AUDIO, DOCUMENTinteger
Number of tokens for the given modality.
integer
Number of tokens in the request. When cachedContent is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
object[]
Breakdown of prompt tokens by modality.
string
Type of input or output content modality.Possible values:
MODALITY_UNSPECIFIED, TEXT, IMAGE, VIDEO, AUDIO, DOCUMENTinteger
Number of tokens for the given modality.
integer
Number of tokens present in thoughts output.
integer
Number of tokens present in tool-use prompt(s).
object[]
모달리티별 도구 사용 프롬프트 토큰의 내역입니다.
string
입력 또는 출력 콘텐츠 모달리티의 유형입니다.가능한 값:
MODALITY_UNSPECIFIED, TEXT, IMAGE, VIDEO, AUDIO, DOCUMENTinteger
해당 모달리티의 토큰 수입니다.
integer
Total number of tokens (prompt + candidates).
string
Traffic type used for the request (e.g., PROVISIONED_THROUGHPUT).
예시
입력
출력
배포 전 확인
SDK는Idempotency-Key를 생성하고 자동 재시도에서 재사용합니다. 수동 재시도 시에는 원래 키를 재사용하세요. Router는 연결을 최대 10분간 유지할 수 있습니다.
요청이 실패하면 Router는 이유를 설명하는 X-Comfy-Error-Type 응답 헤더를 보냅니다. 422는 Router가 프로바이더를 호출하기 전에 입력을 거부했음을 의미합니다. 생성된 에셋은 결과 URL이 만료될 수 있으므로 즉시 다운로드하세요.
헤더
인증, 멱등성, 요청 ID, 오류 분류, 재시도 간격, 지출 한도.
Router API 사용
모델 검색, 유효성 검사 오류, 재시도, 과금.
제한 사항
Router가 현재 지원하지 않는 기능과 대체 방법.