> ## 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.

# Luma Reference - ComfyUI 組み込みノードのドキュメント

> Luma 画像生成に参考画像を提供する補助ノード

![ComfyUI 組み込み Luma Reference ノード](https://mintcdn.com/dripart/5003JSxULDwNImme/images/built-in-nodes/api_nodes/luma/luma-reference.jpg?fit=max\&auto=format\&n=5003JSxULDwNImme\&q=85\&s=95659c8c2dd4e09b26feef3901678c83)

Luma Reference ノードは、Luma 画像生成ノードの作成プロセスをガイドするために参考画像とその重みを設定できるようにします。これにより、生成される画像が参考画像の特定の特徴に近づくようになります。

## ノードの機能

このノードは、Luma 生成ノードの補助ツールとして機能し、ユーザーが生成結果に影響を与えるための参考画像を提供できるようにします。また、参考画像の重みを設定することで、最終結果への影響度を制御できます。\
複数の Luma Reference ノードをチェーン（連鎖）接続することが可能ですが、API の仕様により、同時に動作可能なノード数は最大で 4 つまでです。

## パラメーター

### 基本パラメーター

| パラメーター | 型 | デフォルト値 | 説明 |
| - | - | - | - |
| image | 画像 | - | 参考として使用する入力画像 |
| weight | 浮動小数点数 | 1.0 | 参考画像の影響強度を制御（0～1） |

### 出力

| 出力 | 型 | 説明 |
| - | - | - |
| luma\_ref | LUMA\_REF | 画像と重みを含む参考オブジェクト |

## 使用例

> [card] [Luma Text to Image ワークフローの例](https://docs.comfy.org/ja/tutorials/partner-nodes/luma/luma-text-to-image.md)
>
> Luma Text to Image ワークフローの例

## 動作原理

Luma Reference ノードは画像入力を受信し、重み値を設定できます。このノード自体は画像を直接生成・変更することはありませんが、画像データと重み情報を含む参考オブジェクトを作成し、それを Luma 生成ノードへ渡します。

生成処理中、Luma AI は参考画像の特徴を解析し、設定された重みに基づいてこれらの特徴を生成結果に反映させます。重み値が高いほど、生成画像は参考画像の特徴により近くなります。逆に、重み値が低いほど、参考画像の影響は最終結果に対してわずかになります。

## ソースコード

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

```python theme={null}

class LumaReferenceNode(ComfyNodeABC):
    """
    Holds an image and weight for use with Luma Generate Image node.
    """

    RETURN_TYPES = (LumaIO.LUMA_REF,)
    RETURN_NAMES = ("luma_ref",)
    DESCRIPTION = cleandoc(__doc__ or "")  # Handle potential None value
    FUNCTION = "create_luma_reference"
    CATEGORY = "api node/image/Luma"

    @classmethod
    def INPUT_TYPES(s):
        return {
            "required": {
                "image": (
                    IO.IMAGE,
                    {
                        "tooltip": "Image to use as reference.",
                    },
                ),
                "weight": (
                    IO.FLOAT,
                    {
                        "default": 1.0,
                        "min": 0.0,
                        "max": 1.0,
                        "step": 0.01,
                        "tooltip": "Weight of image reference.",
                    },
                ),
            },
            "optional": {"luma_ref": (LumaIO.LUMA_REF,)},
        }

    def create_luma_reference(
        self, image: torch.Tensor, weight: float, luma_ref: LumaReferenceChain = None
    ):
        if luma_ref is not None:
            luma_ref = luma_ref.clone()
        else:
            luma_ref = LumaReferenceChain()
        luma_ref.add(LumaReference(image=image, weight=round(weight, 2)))
        return (luma_ref,)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.