Comfy-Org/ComfyUI · warning · ValueError

Krea 2 accepts at most 10 image_style_references; received {

Error message

Krea 2 accepts at most 10 image_style_references; received {len(style_reference)}.

What it means

Client-side ValueError from Krea2ImageNode: the API accepts at most 10 image style references per generation, and the incoming style_reference list exceeds that. Validated before the sync_op call, so no credits are spent.

Source

Thrown at comfy_api_nodes/nodes_krea.py:198

        model_choice = model["model"]
        endpoint_path = _MODEL_ENDPOINTS.get(model_choice)
        if endpoint_path is None:
            raise ValueError(f"Unknown Krea 2 model: {model_choice!r}")

        moodboards: list[KreaMoodboard] | None = None
        mb_id = (model.get("moodboard_id") or "").strip()
        if mb_id:
            if not _UUID_RE.match(mb_id):
                raise ValueError(f"moodboard_id must be a UUID (received {mb_id!r}); copy it from the Krea website.")
            mb_strength = model.get("moodboard_strength")
            moodboards = [KreaMoodboard(id=mb_id, strength=0.35 if mb_strength is None else float(mb_strength))]

        style_reference = model.get("style_reference")
        image_style_references: list[KreaImageStyleReference] | None = None
        if style_reference:
            if len(style_reference) > 10:
                raise ValueError(f"Krea 2 accepts at most 10 image_style_references; received {len(style_reference)}.")
            image_style_references = [
                KreaImageStyleReference(url=ref["url"], strength=float(ref["strength"])) for ref in style_reference
            ]
        initial = await sync_op(
            cls,
            ApiEndpoint(path=endpoint_path, method="POST"),
            response_model=KreaJob,
            data=KreaGenerateImageRequest(
                prompt=prompt,
                aspect_ratio=model["aspect_ratio"],
                resolution=model["resolution"],
                seed=seed,
                creativity=model["creativity"],
                moodboards=moodboards,
                image_style_references=image_style_references,
            ),
        )
        job = await poll_op(

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Reduce the style-reference chain to at most 10 entries before the Krea 2 image node.
  2. Audit the chain — often several references have negligible strength and can be dropped.
  3. If more control is needed, combine references into fewer, higher-strength ones or use a moodboard instead.
Defensive patterns

Strategy: validation

Validate before calling

if style_reference and len(style_reference) > 10:
    raise ValueError(f"Trim style references to <= 10 (got {len(style_reference)})")

Type guard

def style_refs_within_limit(refs: list[dict] | None) -> bool:
    return refs is None or len(refs) <= 10

Prevention

When it happens

Trigger: Executing Krea2ImageNode with more than 10 entries in model['style_reference'] — typically built by chaining Krea2StyleReferenceNode more than 10 times and feeding the accumulated chain into the generator.

Common situations: Iterative style-chain workflows where users keep appending references; feeding a style chain from a previous run back into more reference nodes until the cap is exceeded.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/a09bbb7a2f480264. Report an issue: GitHub.