{"record":{"id":"a09bbb7a2f480264","repo":"Comfy-Org/ComfyUI","slug":"krea-2-accepts-at-most-10-image-style-references","errorCode":null,"errorMessage":"Krea 2 accepts at most 10 image_style_references; received {len(style_reference)}.","messagePattern":"Krea 2 accepts at most 10 image_style_references; received (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"comfy_api_nodes/nodes_krea.py","lineNumber":198,"sourceCode":"\n        model_choice = model[\"model\"]\n        endpoint_path = _MODEL_ENDPOINTS.get(model_choice)\n        if endpoint_path is None:\n            raise ValueError(f\"Unknown Krea 2 model: {model_choice!r}\")\n\n        moodboards: list[KreaMoodboard] | None = None\n        mb_id = (model.get(\"moodboard_id\") or \"\").strip()\n        if mb_id:\n            if not _UUID_RE.match(mb_id):\n                raise ValueError(f\"moodboard_id must be a UUID (received {mb_id!r}); copy it from the Krea website.\")\n            mb_strength = model.get(\"moodboard_strength\")\n            moodboards = [KreaMoodboard(id=mb_id, strength=0.35 if mb_strength is None else float(mb_strength))]\n\n        style_reference = model.get(\"style_reference\")\n        image_style_references: list[KreaImageStyleReference] | None = None\n        if style_reference:\n            if len(style_reference) > 10:\n                raise ValueError(f\"Krea 2 accepts at most 10 image_style_references; received {len(style_reference)}.\")\n            image_style_references = [\n                KreaImageStyleReference(url=ref[\"url\"], strength=float(ref[\"strength\"])) for ref in style_reference\n            ]\n        initial = await sync_op(\n            cls,\n            ApiEndpoint(path=endpoint_path, method=\"POST\"),\n            response_model=KreaJob,\n            data=KreaGenerateImageRequest(\n                prompt=prompt,\n                aspect_ratio=model[\"aspect_ratio\"],\n                resolution=model[\"resolution\"],\n                seed=seed,\n                creativity=model[\"creativity\"],\n                moodboards=moodboards,\n                image_style_references=image_style_references,\n            ),\n        )\n        job = await poll_op(","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_krea.py#L180-L216","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Reduce the style-reference chain to at most 10 entries before the Krea 2 image node.","Audit the chain — often several references have negligible strength and can be dropped.","If more control is needed, combine references into fewer, higher-strength ones or use a moodboard instead."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if style_reference and len(style_reference) > 10:\n    raise ValueError(f\"Trim style references to <= 10 (got {len(style_reference)})\")","typeGuard":"def style_refs_within_limit(refs: list[dict] | None) -> bool:\n    return refs is None or len(refs) <= 10","tryCatchPattern":null,"preventionTips":["Count chain links before adding another style-reference node.","Prune negligible-strength references periodically.","Use moodboards for large style sets."],"tags":["krea","api-nodes","validation","style-reference","pre-flight"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}