> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Meshy 7 with Comfy Router

> Call meshy/meshy-7 through Comfy Router: endpoint, request shape and the response Router returns.

`meshy/meshy-7`에 대한 API 레퍼런스이며, Meshy에서 Comfy Router를 통해 제공됩니다.

## 빠른 시작

[Comfy 워크스페이스](https://platform.comfy.org/profile/api-keys)에서 키를 생성하고 `COMFY_API_KEY`로 내보내세요. Python 및 TypeScript 스니펫은 Comfy SDK(`pip install comfy-sdk`, `npm install @comfyorg/sdk`)를 사용하며, cURL 스니펫은 동일한 호출을 raw HTTP로 수행합니다.

**모델 ID:** `meshy/meshy-7`

**엔드포인트:** `POST https://api.comfy.org/v2/models/meshy/meshy-7`

<Tabs>
  <Tab title="Wait for the result">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # Reads COMFY_API_KEY from the environment.
      # The SDK automatically creates an idempotency key and reuses it for automatic retries.
      with Comfy() as client:
          result = client.models.run(
              "meshy/meshy-7",
              {
                  "art_style": "realistic",
                  "mode": "preview",
                  "prompt": "a red cube",
              },
          )

      print(result)
      ```

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

      // Reads COMFY_API_KEY from the environment.
      // The SDK automatically creates an idempotency key and reuses it for automatic retries.
      const { data } = await comfy.models.run("meshy/meshy-7", {
        art_style: "realistic",
        mode: "preview",
        prompt: "a red cube",
      });

      console.log(data);
      ```

      ```bash cURL theme={null}
      curl https://api.comfy.org/v2/models/meshy/meshy-7 \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"art_style\": \"realistic\", \"mode\": \"preview\", \"prompt\": \"a red cube\"}"
      ```
    </CodeGroup>
  </Tab>

  <Tab title="Queue and collect later">
    <CodeGroup>
      ```python Python theme={null}
      from comfy_sdk import Comfy

      # Reads COMFY_API_KEY from the environment.
      # Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
      with Comfy() as client:
          handle = client.models.submit(
              "meshy/meshy-7",
              {
                  "art_style": "realistic",
                  "mode": "preview",
                  "prompt": "a red cube",
              },
          )
          print("request_id:", handle.request_id)  # with the model ID, all another process needs

          # Poll until the request completes, waiting the Retry-After the server names.
          for update in handle.iter_events():
              print(update.status, update.queue_position)

          # The provider's own payload, the same value models.run() returns.
          # A request that failed or was cancelled raises the typed Router error here.
          result = handle.get()

      print(result)
      ```

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

      // Reads COMFY_API_KEY from the environment.
      // Each submit() call mints its own Idempotency-Key and reuses it for automatic retries.
      const handle = await comfy.models.submit("meshy/meshy-7", {
        art_style: "realistic",
        mode: "preview",
        prompt: "a red cube",
      });
      console.log("requestId:", handle.requestId); // with the model ID, all another process needs

      // Poll until the request completes, waiting the Retry-After the server names.
      for await (const update of handle.events()) {
        console.log(update.status, update.queuePosition);
      }

      // The same result models.run() returns. A request that failed or was cancelled rejects here.
      const result = await handle.get();

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

      ```bash cURL theme={null}
      # 1. Submit. Router answers 201 with request_id, status_url, response_url and cancel_url.
      curl https://api.comfy.org/v2/models/meshy/meshy-7/requests \
        -H "X-API-Key: $COMFY_API_KEY" \
        -H "Idempotency-Key: $(uuidgen)" \
        -H "Content-Type: application/json" \
        -d "{\"art_style\": \"realistic\", \"mode\": \"preview\", \"prompt\": \"a red cube\"}"

      # 2. Poll until status is COMPLETED, waiting the Retry-After seconds each response names.
      REQUEST_ID="<request_id from the 201 body>"
      curl -i https://api.comfy.org/v2/models/meshy/meshy-7/requests/$REQUEST_ID/status \
        -H "X-API-Key: $COMFY_API_KEY"

      # 3. Collect. 200 with the model's native output, 202 with the status body while it is still running.
      curl https://api.comfy.org/v2/models/meshy/meshy-7/requests/$REQUEST_ID \
        -H "X-API-Key: $COMFY_API_KEY"
      ```
    </CodeGroup>
  </Tab>
</Tabs>

## 스키마

### 입력

#### `preview` 변형

<ParamField body="ai_model" type="string">
  실행할 Meshy 모델입니다. Comfy Router 경로에서는 경로(`/v2/models/meshy/{model}`)로 제공되며 생략하거나 null로 보낼 수 있습니다. Router는 검증 후 경로의 모델을 여기에 기록합니다. v1 /proxy 경로에서는 MeshyTextTo3DPreviewRequest를 참조하세요. 이는 이를 MeshyAiModel로 제한합니다.
</ParamField>

<ParamField body="art_style" type="string" default="&#x22;realistic&#x22;">
  객체의 원하는 아트 스타일을 설명합니다.

  가능한 값: `realistic`, `sculpture`
</ParamField>

<ParamField body="is_a_t_pose" type="boolean" default="false">
  지원 중단됨. 대신 pose\_mode를 사용하세요. 모델을 A/T 포즈로 생성할지 여부입니다.
</ParamField>

<ParamField body="mode" type="string" required>
  미리보기 작업을 생성할 때 이 필드는 "preview"로 설정해야 합니다.

  가능한 값: `preview`
</ParamField>

<ParamField body="moderation" type="boolean" default="false">
  참일 때 입력 콘텐츠에서 잠재적으로 유해한 콘텐츠를 검사합니다.
</ParamField>

<ParamField body="pose_mode" type="string">
  생성된 모델의 포즈 모드를 지정합니다.

  가능한 값: `a-pose`, `t-pose`, \`\`
</ParamField>

<ParamField body="prompt" type="string" required>
  3D 모델이 어떤 객체인지 설명합니다. 최대 600자입니다.
</ParamField>

<ParamField body="should_remesh" type="boolean" default="true">
  리메시 단계를 활성화할지 제어합니다. 거짓이면 최고 정밀도의 삼각 메시를 반환합니다.
</ParamField>

<ParamField body="symmetry_mode" type="string" default="&#x22;auto&#x22;">
  모델 생성 중 대칭 동작을 제어합니다.

  가능한 값: `off`, `auto`, `on`
</ParamField>

<ParamField body="target_polycount" type="integer" default="30000">
  생성된 모델의 목표 폴리곤 수를 지정합니다. 유효 범위는 100에서 300,000입니다.

  범위: `100` \~ `300000`
</ParamField>

<ParamField body="topology" type="string" default="&#x22;triangle&#x22;">
  생성된 모델의 토폴로지를 지정합니다.

  가능한 값: `quad`, `triangle`
</ParamField>

<ParamField body="ultra_mode" type="boolean" default="false">
  더 세밀한 표면 디테일과 함께 더 높은 충실도의 지오메트리를 위해 Ultra 생성을 활성화합니다. ai\_model이 meshy-7 또는 latest인 경우에만 지원됩니다.
</ParamField>

#### `refine` 변형

<ParamField body="ai_model" type="string">
  실행할 Meshy 모델입니다. Comfy Router 경로에서는 경로(`/v2/models/meshy/{model}`)로 제공되며 생략하거나 null로 보낼 수 있습니다. Router는 검증 후 경로의 모델을 여기에 기록합니다. v1 /proxy 경로에서는 MeshyTextTo3DRefineRequest를 참조하세요. 이는 이를 MeshyAiModel로 제한합니다.
</ParamField>

<ParamField body="enable_pbr" type="boolean" default="false">
  기본 색상 외에 PBR 맵(metallic, roughness, normal)을 생성합니다. Sculpture 스타일을 사용할 때는 enable\_pbr를 거짓으로 설정해야 합니다.
</ParamField>

<ParamField body="mode" type="string" required>
  refine 작업을 생성할 때 이 필드는 "refine"으로 설정해야 합니다.

  가능한 값: `refine`
</ParamField>

<ParamField body="moderation" type="boolean" default="false">
  참일 때 입력 콘텐츠에서 잠재적으로 유해한 콘텐츠를 검사합니다.
</ParamField>

<ParamField body="preview_task_id" type="string" required>
  해당 미리보기 작업 id입니다. 지정한 미리보기 작업의 상태가 SUCCEEDED여야 합니다.
</ParamField>

<ParamField body="texture_image_url" type="string">
  텍스처링 과정을 안내할 2D 이미지를 제공합니다. .jpg, .jpeg, .png 형식 또는 base64로 인코딩된 data URI를 지원합니다.
</ParamField>

<ParamField body="texture_prompt" type="string">
  텍스처링 과정을 안내할 추가 텍스트 프롬프트를 제공합니다. 최대 600자입니다.
</ParamField>

<ParamField body="texture_resolution" type="string" default="&#x22;2k&#x22;">
  생성된 텍스처의 해상도입니다. 2k, 4k, 8k 중 하나입니다. 4k와 8k는 ai\_model이 meshy-6, meshy-7 또는 latest여야 합니다.

  가능한 값: `2k`, `4k`, `8k`
</ParamField>

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

### 출력

<ResponseField name="art_style" type="string">
  미리보기 작업을 생성하는 데 사용된, 수정되지 않은 art\_style입니다.
</ResponseField>

<ResponseField name="created_at" type="integer">
  작업이 생성된 시점의 타임스탬프(밀리초)입니다.

  형식: `int64`
</ResponseField>

<ResponseField name="finished_at" type="integer">
  작업이 완료된 시점의 타임스탬프(밀리초)입니다. 완료되지 않은 경우 0입니다.

  형식: `int64`
</ResponseField>

<ResponseField name="id" type="string" required>
  작업의 고유 식별자입니다.
</ResponseField>

<ResponseField name="model_urls" type="object">
  Meshy에서 생성한 텍스처가 적용된 3D 모델 파일의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="model_urls.fbx" type="string">
  FBX 파일의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="model_urls.glb" type="string">
  GLB 파일의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="model_urls.mtl" type="string">
  MTL 파일의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="model_urls.obj" type="string">
  OBJ 파일의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="model_urls.usdz" type="string">
  USDZ 파일의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="negative_prompt" type="string">
  하위 호환성을 위해 유지되는 지원 중단된 필드입니다.
</ResponseField>

<ResponseField name="preceding_tasks" type="integer">
  선행 작업의 수입니다. status가 PENDING일 때만 의미가 있습니다.
</ResponseField>

<ResponseField name="progress" type="integer">
  작업의 진행률입니다. 시작되지 않은 경우 0이며, 성공한 경우 100입니다.

  범위: `0` \~ `100`
</ResponseField>

<ResponseField name="prompt" type="string">
  작업을 생성하는 데 사용된, 수정되지 않은 프롬프트입니다.
</ResponseField>

<ResponseField name="started_at" type="integer">
  작업이 시작된 시점의 타임스탬프(밀리초)입니다. 시작되지 않은 경우 0입니다.

  형식: `int64`
</ResponseField>

<ResponseField name="status" type="string" required>
  가능한 값: `SUCCEEDED`
</ResponseField>

<ResponseField name="task_error" type="object">
  작업이 실패한 경우 오류 메시지를 포함하는 오류 객체입니다.
</ResponseField>

<ResponseField name="task_error.message" type="string">
  자세한 오류 메시지입니다.
</ResponseField>

<ResponseField name="texture_image_url" type="string">
  텍스처링 과정을 안내하는 데 사용된 텍스처 이미지의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="texture_prompt" type="string">
  refine 단계에서 텍스처링 과정을 안내하기 위해 제공된 추가 텍스트 프롬프트입니다.
</ResponseField>

<ResponseField name="texture_richness" type="string">
  하위 호환성을 위해 유지되는 지원 중단된 필드입니다.
</ResponseField>

<ResponseField name="texture_urls" type="object[]">
  작업에서 생성된 텍스처 URL 객체의 배열입니다.
</ResponseField>

<ResponseField name="texture_urls[].base_color" type="string">
  베이스 색상 맵 이미지의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="texture_urls[].metallic" type="string">
  메탈릭 맵 이미지의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="texture_urls[].normal" type="string">
  노멀(normal) 맵 이미지의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="texture_urls[].roughness" type="string">
  러프니스 맵 이미지의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="thumbnail_url" type="string">
  모델 파일의 썸네일 이미지의 다운로드 가능한 URL입니다.
</ResponseField>

<ResponseField name="type" type="string">
  텍스트 기반 3D 생성 작업의 유형입니다.

  가능한 값: `text-to-3d-preview`, `text-to-3d-refine`
</ResponseField>

<ResponseField name="video_url" type="string">
  미리보기 비디오의 다운로드 가능한 URL을 반환하는 지원 중단된 필드입니다.
</ResponseField>

## 예시

### 입력

```json theme={null}
{
  "art_style": "realistic",
  "mode": "preview",
  "prompt": "a red cube"
}
```

### 출력

```json theme={null}
{
  "art_style": "realistic",
  "created_at": 1767225600000,
  "finished_at": 1767225719000,
  "id": "018f2c7a-4b1e-7c3d-9a05-6e2f8b41d0c9",
  "model_urls": {
    "fbx": "https://example.invalid/meshy/text-to-3d/model.fbx",
    "glb": "https://example.invalid/meshy/text-to-3d/model.glb",
    "mtl": "https://example.invalid/meshy/text-to-3d/model.mtl",
    "obj": "https://example.invalid/meshy/text-to-3d/model.obj",
    "usdz": "https://example.invalid/meshy/text-to-3d/model.usdz"
  },
  "progress": 100,
  "prompt": "a red cube",
  "started_at": 1767225601000,
  "status": "SUCCEEDED",
  "thumbnail_url": "https://example.invalid/meshy/text-to-3d/thumbnail.png",
  "type": "text-to-3d-preview"
}
```

## 배포 전 확인

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

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

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

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

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