> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-chore-mintlify-theme-mint.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Comfy Router로 Veo 3.0 Fast Generate 001 사용하기

> Comfy Router를 통해 veo/veo-3.0-fast-generate-001을 호출하는 방법을 설명합니다: 엔드포인트, 요청 형태, 그리고 Router가 반환하는 응답.

`veo/veo-3.0-fast-generate-001`에 대한 API 레퍼런스입니다. Veo에서 Comfy Router를 통해 제공됩니다.

## 빠른 시작

[Comfy 워크스페이스](https://platform.comfy.org/profile/api-keys?onboarding=router)에서 키를 생성하고 `COMFY_API_KEY`로 내보내세요. Python, TypeScript, Swift 스니펫은 Comfy SDK(`pip install comfy-sdk`, `npm install @comfyorg/sdk`, 그리고 [`ComfySwiftSDK`](https://github.com/Comfy-Org/comfy-swift-sdk) Swift 패키지)를 사용하며, cURL 스니펫은 원시 HTTP를 통한 동일한 호출입니다.

**모델 ID:** `veo/veo-3.0-fast-generate-001`

**엔드포인트:** `POST https://api.comfy.org/v2/models/veo/veo-3.0-fast-generate-001`

<Tabs>
  <Tab title="결과를 기다리기">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # 환경에서 COMFY_API_KEY를 읽습니다.
      # SDK는 자동으로 idempotency 키를 생성하고 자동 재시도에 재사용합니다.
      with Comfy() as client:
          result = client.models.run(
              "veo/veo-3.0-fast-generate-001",
              {
                  "instances": [
                      {
                          "prompt": "a single red maple leaf falling onto still water, slow motion",
                      },
                  ],
                  "parameters": {
                      "durationSeconds": 4,
                      "generateAudio": False,
                      "sampleCount": 1,
                  },
              },
          )

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // 환경에서 COMFY_API_KEY를 읽습니다.
      // SDK는 자동으로 idempotency 키를 생성하고 자동 재시도에 재사용합니다.
      const { data } = await comfy.models.run("veo/veo-3.0-fast-generate-001", {
        instances: [
          {
            prompt: "a single red maple leaf falling onto still water, slow motion",
          },
        ],
        parameters: {
          durationSeconds: 4,
          generateAudio: false,
          sampleCount: 1,
        },
      });

      console.log(data);
      ```

      ```swift Swift theme={null}
      import Foundation
      import ComfySwiftSDK

      // 환경에서 COMFY_API_KEY를 읽습니다.
      // SDK는 호출마다 idempotency 키를 생성하고 자동 재시도에 재사용합니다.
      let client = ComfyCloudClient(apiKey: ProcessInfo.processInfo.environment["COMFY_API_KEY"]!)
      let result = try await client.models.run(
          "veo/veo-3.0-fast-generate-001",
          input: [
              "instances": [
                  [
                      "prompt": "a single red maple leaf falling onto still water, slow motion",
                  ],
              ],
              "parameters": [
                  "durationSeconds": 4,
                  "generateAudio": false,
                  "sampleCount": 1,
              ],
          ]
      )

      print(result.output)
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/veo/veo-3.0-fast-generate-001 \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"instances\": [{\"prompt\":\"a single red maple leaf falling onto still water, slow motion\"}], \"parameters\": {\"durationSeconds\":4,\"generateAudio\":false,\"sampleCount\":1}}"
      ```
    </CodeGroup>
  </Tab>

  <Tab title="대기열에 제출하고 나중에 수집">
    동일한 본문을 `POST https://api.comfy.org/v2/models/veo/veo-3.0-fast-generate-001/requests`로 전송합니다. 라우터는 실행이 접수되는 즉시 `request_id`와 함께 `201`로 응답하며, 결과는 준비되면 이 프로세스 또는 다른 프로세스에서 수집됩니다. [대기열 전송](/ko/development/comfy-router/queue)에서 상태, 취소, 수집 과정을 자세히 안내합니다.

    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # 환경에서 COMFY_API_KEY를 읽습니다.
      # 각 submit() 호출은 자체 Idempotency-Key를 생성하고 자동 재시도에 재사용합니다.
      with Comfy() as client:
          handle = client.models.submit(
              "veo/veo-3.0-fast-generate-001",
              {
                  "instances": [
                      {
                          "prompt": "a single red maple leaf falling onto still water, slow motion",
                      },
                  ],
                  "parameters": {
                      "durationSeconds": 4,
                      "generateAudio": False,
                      "sampleCount": 1,
                  },
              },
          )
          print("request_id:", handle.request_id)  # 모델 ID와 함께라면, 다른 프로세스에 필요한 전부입니다

          # 요청이 완료될 때까지 폴링하며, 서버가 알려주는 Retry-After만큼 대기합니다.
          for update in handle.iter_events():
              print(update.status, update.queue_position)

          # 공급자 자체의 페이로드이며, models.run()이 반환하는 것과 동일한 값입니다.
          # 실패했거나 취소된 요청은 여기에서 타입이 지정된 Router 오류를 발생시킵니다.
          result = handle.get()

      print(result)
      ```

      ```typescript TypeScript theme={null}
      import { comfy } from "@comfyorg/sdk";

      // 환경에서 COMFY_API_KEY를 읽습니다.
      // 각 submit() 호출은 자체 Idempotency-Key를 생성하고 자동 재시도에 재사용합니다.
      const handle = await comfy.models.submit("veo/veo-3.0-fast-generate-001", {
        instances: [
          {
            prompt: "a single red maple leaf falling onto still water, slow motion",
          },
        ],
        parameters: {
          durationSeconds: 4,
          generateAudio: false,
          sampleCount: 1,
        },
      });
      console.log("requestId:", handle.requestId); // 모델 ID와 함께라면, 다른 프로세스에 필요한 전부입니다

      // 요청이 완료될 때까지 폴링하며, 서버가 알려주는 Retry-After만큼 대기합니다.
      for await (const update of handle.events()) {
        console.log(update.status, update.queuePosition);
      }

      // models.run()이 반환하는 것과 동일한 결과입니다. 실패했거나 취소된 요청은 여기에서 거부됩니다.
      const result = await handle.get();

      console.log(result.data);
      ```

      ```swift Swift theme={null}
      import Foundation
      import ComfySwiftSDK

      // 환경에서 COMFY_API_KEY를 읽습니다.
      // 각 submit() 호출은 자체 Idempotency-Key를 생성하고 자동 재시도에 재사용합니다.
      let client = ComfyCloudClient(apiKey: ProcessInfo.processInfo.environment["COMFY_API_KEY"]!)
      let handle = try await client.models.submit(
          "veo/veo-3.0-fast-generate-001",
          input: [
              "instances": [
                  [
                      "prompt": "a single red maple leaf falling onto still water, slow motion",
                  ],
              ],
              "parameters": [
                  "durationSeconds": 4,
                  "generateAudio": false,
                  "sampleCount": 1,
              ],
          ]
      )
      print("requestId:", handle.requestId)  // 모델 ID와 함께라면, 다른 프로세스에 필요한 전부입니다

      // 요청이 완료될 때까지 폴링하며, 서버가 알려주는 Retry-After만큼 대기합니다.
      for try await update in handle.events() {
          print(update.state.rawValue, update.queuePosition.map(String.init) ?? "unknown")
      }

      // 공급자 자체의 페이로드이며, models.run()이 반환하는 것과 동일한 값입니다.
      // 실패했거나 취소된 요청은 여기에서 타입이 지정된 Router 오류를 던집니다.
      let result = try await handle.result()

      print(result.output)
      ```

      ```bash cURL theme={null}
      # 1. 제출합니다. 라우터는 request_id, status_url, response_url, cancel_url과 함께 201로 응답합니다.
      curl https://api.comfy.org/v2/models/veo/veo-3.0-fast-generate-001/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"instances\": [{\"prompt\":\"a single red maple leaf falling onto still water, slow motion\"}], \"parameters\": {\"durationSeconds\":4,\"generateAudio\":false,\"sampleCount\":1}}"

      # 2. 상태가 COMPLETED가 될 때까지 폴링하며, 각 응답이 알려주는 Retry-After 초만큼 대기합니다.
      REQUEST_ID="<request_id from the 201 body>"
      curl -i https://api.comfy.org/v2/models/veo/veo-3.0-fast-generate-001/requests/$REQUEST_ID/status \
        -H "X-API-Key: $COMFY_API_KEY"

      # 3. 수집합니다. 모델의 네이티브 출력과 함께 200, 아직 실행 중이면 상태 본문과 함께 202를 반환합니다.
      curl https://api.comfy.org/v2/models/veo/veo-3.0-fast-generate-001/requests/$REQUEST_ID \
        -H "X-API-Key: $COMFY_API_KEY"
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## 스키마

### 입력

<ParamField body="instances" type="object[]" />

<ParamField body="instances[].cameraControl" type="string">
  카메라 모션 유형입니다. 이미지가 제공되어야 합니다.

  가능한 값: `fixed`, `pan_left`, `pan_right`, `tilt_up`, `tilt_down`, `truck_left`, `truck_right`, `pedestal_up`, `pedestal_down`, `push_in`, `pull_out`
</ParamField>

<ParamField body="instances[].image" type="object">
  비디오 생성을 유도하는 선택적 첫 프레임 이미지입니다.
</ParamField>

<ParamField body="instances[].image.bytesBase64Encoded" type="string (byte)">
  Base64로 인코딩된 이미지 데이터입니다.

  형식: `byte`
</ParamField>

<ParamField body="instances[].image.gcsUri" type="string">
  이미지의 Cloud Storage URI입니다.
</ParamField>

<ParamField body="instances[].image.mimeType" type="string">
  이미지의 MIME 유형입니다(image/jpeg 또는 image/png).

  가능한 값: `image/jpeg`, `image/png`
</ParamField>

<ParamField body="instances[].lastFrame" type="object">
  선택적 마지막 프레임 이미지입니다. image와 함께 사용하여 첫 프레임과 마지막 프레임 사이의 비디오를 생성합니다. Veo 3.0+ 모델에서 지원됩니다.
</ParamField>

<ParamField body="instances[].lastFrame.bytesBase64Encoded" type="string (byte)">
  Base64로 인코딩된 이미지 데이터입니다.

  형식: `byte`
</ParamField>

<ParamField body="instances[].lastFrame.gcsUri" type="string">
  이미지의 Cloud Storage URI입니다.
</ParamField>

<ParamField body="instances[].lastFrame.mimeType" type="string">
  이미지의 MIME 유형입니다(image/jpeg 또는 image/png).

  가능한 값: `image/jpeg`, `image/png`
</ParamField>

<ParamField body="instances[].mask" type="object">
  비디오 편집을 위한 선택적 마스크입니다. 입력 비디오에 적용됩니다.
</ParamField>

<ParamField body="instances[].mask.bytesBase64Encoded" type="string (byte)">
  Base64로 인코딩된 마스크 바이트입니다.

  형식: `byte`
</ParamField>

<ParamField body="instances[].mask.gcsUri" type="string">
  마스크 파일의 Cloud Storage URI입니다.
</ParamField>

<ParamField body="instances[].mask.maskMode" type="string">
  마스크가 적용되는 방식입니다.

  가능한 값: `insert`, `remove`, `remove_static`, `outpaint`
</ParamField>

<ParamField body="instances[].mask.mimeType" type="string">
  마스크의 MIME 유형입니다(image/png, image/jpeg, image/webp 또는 비디오 형식).
</ParamField>

<ParamField body="instances[].prompt" type="string" required>
  생성할 비디오에 대한 텍스트 설명입니다.
</ParamField>

<ParamField body="instances[].referenceImages" type="object[]">
  비디오 생성을 유도하는 선택적 참조 이미지입니다. 최대 3개의 asset 이미지 또는 1개의 style 이미지를 지원합니다. Veo 3.1 모델(미리보기)에서 지원됩니다.
</ParamField>

<ParamField body="instances[].referenceImages[].image" type="object" required />

<ParamField body="instances[].referenceImages[].image.bytesBase64Encoded" type="string (byte)">
  Base64로 인코딩된 이미지 데이터입니다.

  형식: `byte`
</ParamField>

<ParamField body="instances[].referenceImages[].image.gcsUri" type="string">
  이미지의 Cloud Storage URI입니다.
</ParamField>

<ParamField body="instances[].referenceImages[].image.mimeType" type="string">
  이미지의 MIME 유형입니다(image/jpeg 또는 image/png).

  가능한 값: `image/jpeg`, `image/png`
</ParamField>

<ParamField body="instances[].referenceImages[].referenceId" type="string">
  참조 이미지에 대한 선택적 식별자입니다.
</ParamField>

<ParamField body="instances[].referenceImages[].referenceType" type="string" required>
  참조 이미지의 유형입니다.

  가능한 값: `asset`, `style`
</ParamField>

<ParamField body="instances[].video" type="object">
  비디오 확장 또는 편집을 위한 선택적 입력 비디오입니다. image 및 referenceImages와 함께 사용할 수 없습니다.
</ParamField>

<ParamField body="instances[].video.bytesBase64Encoded" type="string (byte)">
  Base64로 인코딩된 비디오 바이트입니다.

  형식: `byte`
</ParamField>

<ParamField body="instances[].video.gcsUri" type="string">
  입력 비디오의 Cloud Storage URI입니다.
</ParamField>

<ParamField body="instances[].video.mimeType" type="string">
  비디오의 MIME 유형입니다.

  가능한 값: `video/mov`, `video/mpeg`, `video/mp4`, `video/mpg`, `video/avi`, `video/wmv`, `video/mpegps`, `video/x-flv`
</ParamField>

<ParamField body="parameters" type="object" />

<ParamField body="parameters.aspectRatio" type="string">
  생성된 비디오의 화면 비율입니다. 기본값: 16:9

  가능한 값: `16:9`, `9:16`
</ParamField>

<ParamField body="parameters.compressionQuality" type="string">
  비디오 압축 품질입니다. 기본값: optimized

  가능한 값: `optimized`, `lossless`
</ParamField>

<ParamField body="parameters.durationSeconds" type="number">
  생성된 비디오의 목표 재생 시간(초)입니다. Veo 2: 5-8. Veo 3/3.1: 4, 6 또는 8. 기본값: 8
</ParamField>

<ParamField body="parameters.enhancePrompt" type="boolean">
  더 높은 품질을 위해 프롬프트를 자동으로 개선합니다. 기본값은 참입니다.
</ParamField>

<ParamField body="parameters.fps" type="integer">
  생성된 비디오의 프레임 속도(초당 프레임 수)입니다.
</ParamField>

<ParamField body="parameters.generateAudio" type="boolean">
  비디오와 함께 오디오를 생성할지 여부입니다. 기본값은 참입니다. Veo 3.0+ 모델에서 지원됩니다.
</ParamField>

<ParamField body="parameters.negativePrompt" type="string">
  생성된 비디오에서 피해야 할 내용을 설명하는 텍스트입니다.
</ParamField>

<ParamField body="parameters.personGeneration" type="string">
  생성된 비디오에서 사람을 제어합니다. 기본값: allow\_adult

  가능한 값: `dont_allow`, `allow_adult`, `allowAll`
</ParamField>

<ParamField body="parameters.pubsubTopic" type="string">
  진행 상황 업데이트를 위한 Cloud Pub/Sub 주제입니다(projects/\{project}/topics/\{topic}).
</ParamField>

<ParamField body="parameters.resizeMode" type="string">
  입력 이미지에 대한 크기 조정 방식입니다. 기본값: pad

  가능한 값: `pad`, `crop`
</ParamField>

<ParamField body="parameters.resolution" type="string">
  출력 비디오 해상도입니다. Veo 3.0+ 모델에서 지원됩니다. 기본값: 720p

  가능한 값: `720p`, `1080p`, `4k`
</ParamField>

<ParamField body="parameters.sampleCount" type="integer">
  생성할 비디오 수입니다. 지정하지 않으면 비디오 1개가 생성됩니다.

  Range: `1` to `4`
</ParamField>

<ParamField body="parameters.seed" type="integer">
  결정론적 출력을 위한 랜덤 시드입니다. sampleCount > 1인 경우 비디오마다 다른 시드가 사용됩니다.

  형식: `uint32`
</ParamField>

<ParamField body="parameters.storageUri" type="string">
  생성된 비디오를 저장하기 위한 Cloud Storage URI(gs\://)
</ParamField>

<ParamField body="parameters.task" type="string">
  비디오 생성 요청의 작업 유형

  가능한 값:  `textToVideo`, `imageToVideo`, `referenceToVideo`, `edit`, `extend`, `upscale`
</ParamField>

Router가 `GET /v2/models/veo-3.0-fast-generate-001/openapi.json`에서 제공하는 스키마를 기반으로 생성되었으며, 이는 요청이 공급자에게 도달하기 이전에 호출을 검증하는 데 사용하는 것과 동일한 문서입니다.

### 출력

<ResponseField name="done" type="boolean">
  작업이 완료되었는지 여부
</ResponseField>

<ResponseField name="error" type="object">
  오류 세부 정보, 작업이 실패한 경우 제공됨
</ResponseField>

<ResponseField name="error.code" type="integer">
  gRPC 오류 코드
</ResponseField>

<ResponseField name="error.message" type="string">
  오류 메시지
</ResponseField>

<ResponseField name="name" type="string">
  작업 리소스 이름
</ResponseField>

<ResponseField name="response" type="object">
  예측 응답으로, done이 참일 때 제공됨
</ResponseField>

<ResponseField name="response.@type" type="string" />

<ResponseField name="response.raiMediaFilteredCount" type="integer">
  책임 있는 AI 정책에 의해 필터링된 비디오 수
</ResponseField>

<ResponseField name="response.raiMediaFilteredReasons" type="string[]">
  책임 있는 AI 정책에 의해 비디오가 필터링된 이유
</ResponseField>

<ResponseField name="response.videos" type="object[]" />

<ResponseField name="response.videos[].bytesBase64Encoded" type="string">
  Base64로 인코딩된 비디오 콘텐츠
</ResponseField>

<ResponseField name="response.videos[].gcsUri" type="string">
  생성된 비디오의 Cloud Storage URI
</ResponseField>

<ResponseField name="response.videos[].mimeType" type="string">
  비디오 MIME 유형 (video/mp4)
</ResponseField>

## 예시

### 입력

```json theme={null}
{
  "instances": [
    {
      "prompt": "a single red maple leaf falling onto still water, slow motion"
    }
  ],
  "parameters": {
    "durationSeconds": 4,
    "generateAudio": false,
    "sampleCount": 1
  }
}
```

### 출력

```json theme={null}
{
  "done": true,
  "name": "projects/example-project/locations/us-central1/publishers/google/models/veo-3.1-fast-generate-001/operations/1a2b3c4d",
  "response": {
    "@type": "type.googleapis.com/cloud.ai.large_models.vision.GenerateVideoResponse",
    "raiMediaFilteredCount": 0,
    "videos": [
      {
        "gcsUri": "https://storage.googleapis.com/EXAMPLE_BUCKET/veo/USER_ID/REQUEST_ID/sample_0.mp4",
        "mimeType": "video/mp4"
      }
    ]
  }
}
```

## 배포 전 확인

SDK는 `Idempotency-Key`를 생성하고 자동 재시도에 재사용합니다. 수동으로 재시도할 때는 원본 키를 재사용하세요. Router는 연결을 최대 10분간 유지할 수 있습니다.

요청이 실패하면 Router는 그 이유를 설명하는 `X-Comfy-Error-Type` 응답 헤더를 보냅니다. `422`는 Router가 공급자를 호출하기 전에 입력을 거부했음을 의미하고, `413`은 요청 본문이 Router가 허용하는 크기보다 컸음을 의미합니다. [결과 URL이 만료](/ko/development/comfy-router/reference#결과-에셋)될 수 있으므로 생성된 에셋은 즉시 다운로드하세요.

위의 필드 설명에 명시된 크기 제한은 해당 필드에 대한 공급자 자체의 한도이며, 공급자 사양에서 인용한 것입니다. Router는 전체 요청 본문에 별도의 상한을 적용하며, base64로 인코딩된 미디어도 여기에 포함됩니다. [요청 본문 크기](/ko/development/comfy-router/limitations)를 참고하세요.

이 페이지는 Comfy Router를 통해 호출하는 하나의 파트너 모델을 설명합니다. 동일한 `comfy-sdk` / `@comfyorg/sdk` 패키지에는 Comfy Cloud에서 전체 ComfyUI 워크플로 그래프를 실행하기 위한 두 번째 클라이언트도 포함되어 있습니다: `Comfy(api_key=...)` / `new Comfy({ apiKey })`, 그리고 `client.workflows`, `client.assets`, `client.jobs`가 있습니다. [Comfy SDKs](/ko/development/api-development/sdks)를 참조하세요.

<CardGroup cols={3}>
  <Card title="헤더" icon="list" href="/ko/development/comfy-router/headers">
    인증, 멱등성, 요청 ID, 오류 분류, 재시도 간격, 지출 한도.
  </Card>

  <Card title="Router API 사용" icon="code" href="/ko/development/comfy-router/api">
    모델 검색, 검증 오류, 재시도, 과금.
  </Card>

  <Card title="제한 사항" icon="triangle-exclamation" href="/ko/development/comfy-router/limitations">
    Router가 현재 지원하지 않는 기능과 대신 사용할 방법.
  </Card>
</CardGroup>
