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

# Ideogram V2 - ComfyUI 組み込みノードのドキュメント

> Ideogram V2 API を使用して高品質な画像およびテキストレンダリングを生成するノード

<img src="https://mintcdn.com/dripart-docs-recommend-assets-api/AUn0Hv07XaBPEq8v/images/built-in-nodes/api_nodes/ideogram/ideogram-v2.jpg?fit=max&auto=format&n=AUn0Hv07XaBPEq8v&q=85&s=453d619f3e070893a219032f469a1093" alt="ComfyUI 組み込み Ideogram V2 ノード" width="1731" height="1549" data-path="images/built-in-nodes/api_nodes/ideogram/ideogram-v2.jpg" />

Ideogram V2 ノードは、Ideogram の第2世代 AI モデルを活用して、より洗練された画像を生成します。特にテキストのレンダリング品質、画像全体の画質、および美観において大幅な向上が図られています。

## パラメーター

### 必須パラメーター

| パラメーター | 型    | デフォルト値 | 説明                                          |
| ------ | ---- | ------ | ------------------------------------------- |
| prompt | 文字列  | ""     | 生成対象のコンテンツを記述するテキストプロンプト                    |
| turbo  | ブール値 | False  | Turbo モードを使用するかどうか（生成速度は速いが、画質がやや低下する可能性あり） |

### オプションパラメーター

| パラメーター                | 型   | デフォルト値 | 説明                                                                                          |
| --------------------- | --- | ------ | ------------------------------------------------------------------------------------------- |
| aspect\_ratio         | 選択肢 | "1:1"  | 画像のアスペクト比。`resolution` が `"Auto"` に設定されている場合に有効                                             |
| resolution            | 選択肢 | "Auto" | 出力画像の解像度。`"Auto"` 以外に設定した場合、`aspect_ratio` の設定を上書きします                                       |
| magic\_prompt\_option | 選択肢 | "AUTO" | 生成時に MagicPrompt 機能を利用するかどうかを指定します。選択肢は `["AUTO", "ON", "OFF"]` です                          |
| seed                  | 整数  | 0      | 乱数シード値（範囲：0～2147483647）                                                                     |
| style\_type           | 選択肢 | "NONE" | 生成スタイルの種類（V2 専用）。選択肢は `["AUTO", "GENERAL", "REALISTIC", "DESIGN", "RENDER_3D", "ANIME"]` です |
| negative\_prompt      | 文字列 | ""     | 画像内に出現してほしくない要素を指定します                                                                       |
| num\_images           | 整数  | 1      | 生成する画像の枚数（範囲：1～8）                                                                           |

### 出力

| 出力    | 型  | 説明      |
| ----- | -- | ------- |
| IMAGE | 画像 | 生成された画像 |

## ソースコード

\[ノードのソースコード（2025-05-03 更新）]

```python theme={null}

class IdeogramV2(ComfyNodeABC):
    """
    Generates images synchronously using the Ideogram V2 model.

    Images links are available for a limited period of time; if you would like to keep the image, you must download it.
    """

    def __init__(self):
        pass

    @classmethod
    def INPUT_TYPES(cls) -> InputTypeDict:
        return {
            "required": {
                "prompt": (
                    IO.STRING,
                    {
                        "multiline": True,
                        "default": "",
                        "tooltip": "Prompt for the image generation",
                    },
                ),
                "turbo": (
                    IO.BOOLEAN,
                    {
                        "default": False,
                        "tooltip": "Whether to use turbo mode (faster generation, potentially lower quality)",
                    }
                ),
            },
            "optional": {
                "aspect_ratio": (
                    IO.COMBO,
                    {
                        "options": list(V1_V2_RATIO_MAP.keys()),
                        "default": "1:1",
                        "tooltip": "The aspect ratio for image generation. Ignored if resolution is not set to AUTO.",
                    },
                ),
                "resolution": (
                    IO.COMBO,
                    {
                        "options": list(V1_V1_RES_MAP.keys()),
                        "default": "Auto",
                        "tooltip": "The resolution for image generation. If not set to AUTO, this overrides the aspect_ratio setting.",
                    },
                ),
                "magic_prompt_option": (
                    IO.COMBO,
                    {
                        "options": ["AUTO", "ON", "OFF"],
                        "default": "AUTO",
                        "tooltip": "Determine if MagicPrompt should be used in generation",
                    },
                ),
                "seed": (
                    IO.INT,
                    {
                        "default": 0,
                        "min": 0,
                        "max": 2147483647,
                        "step": 1,
                        "control_after_generate": True,
                        "display": "number",
                    },
                ),
                "style_type": (
                    IO.COMBO,
                    {
                        "options": ["AUTO", "GENERAL", "REALISTIC", "DESIGN", "RENDER_3D", "ANIME"],
                        "default": "NONE",
                        "tooltip": "Style type for generation (V2 only)",
                    },
                ),
                "negative_prompt": (
                    IO.STRING,
                    {
                        "multiline": True,
                        "default": "",
                        "tooltip": "Description of what to exclude from the image",
                    },
                ),
                "num_images": (
                    IO.INT,
                    {"default": 1, "min": 1, "max": 8, "step": 1, "display": "number"},
                ),
                #"color_palette": (
                #    IO.STRING,
                #    {
                #        "multiline": False,
                #        "default": "",
                #        "tooltip": "Color palette preset name or hex colors with weights",
                #    },
                #),
            },
            "hidden": {"auth_token": "AUTH_TOKEN_COMFY_ORG"},
        }

    RETURN_TYPES = (IO.IMAGE,)
    FUNCTION = "api_call"
    CATEGORY = "api node/image/ideogram/v2"
    DESCRIPTION = cleandoc(__doc__ or "")
    API_NODE = True

    def api_call(
        self,
        prompt,
        turbo=False,
        aspect_ratio="1:1",
        resolution="Auto",
        magic_prompt_option="AUTO",
        seed=0,
        style_type="NONE",
        negative_prompt="",
        num_images=1,
        color_palette="",
        auth_token=None,
    ):
        aspect_ratio = V1_V2_RATIO_MAP.get(aspect_ratio, None)
        resolution = V1_V1_RES_MAP.get(resolution, None)
        # Determine the model based on turbo setting
        model = "V_2_TURBO" if turbo else "V_2"

        # Handle resolution vs aspect_ratio logic
        # If resolution is not AUTO, it overrides aspect_ratio
        final_resolution = None
        final_aspect_ratio = None

        if resolution != "AUTO":
            final_resolution = resolution
        else:
            final_aspect_ratio = aspect_ratio if aspect_ratio != "ASPECT_1_1" else None

        operation = SynchronousOperation(
            endpoint=ApiEndpoint(
                path="/proxy/ideogram/generate",
                method=HttpMethod.POST,
                request_model=IdeogramGenerateRequest,
                response_model=IdeogramGenerateResponse,
            ),
            request=IdeogramGenerateRequest(
                image_request=ImageRequest(
                    prompt=prompt,
                    model=model,
                    num_images=num_images,
                    seed=seed,
                    aspect_ratio=final_aspect_ratio,
                    resolution=final_resolution,
                    magic_prompt_option=(
                        magic_prompt_option if magic_prompt_option != "AUTO" else None
                    ),
                    style_type=style_type if style_type != "NONE" else None,
                    negative_prompt=negative_prompt if negative_prompt else None,
                    color_palette=color_palette if color_palette else None,
                )
            ),
            auth_token=auth_token,
        )

        response = operation.execute()

        if not response.data or len(response.data) == 0:
            raise Exception("No images were generated in the response")

        image_urls = [image_data.url for image_data in response.data if image_data.url]

        if not image_urls:
            raise Exception("No image URLs were generated in the response")

        return (download_and_process_images(image_urls),)
```
