{"record":{"id":"9c4fea1215400a87","repo":"Comfy-Org/ComfyUI","slug":"krea-2-accepts-at-most-10-image-style-references-i","errorCode":null,"errorMessage":"Krea 2 accepts at most 10 image_style_references in one generation.","messagePattern":"Krea 2 accepts at most 10 image_style_references in one generation\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"comfy_api_nodes/nodes_krea.py","lineNumber":278,"sourceCode":"            ],\n            outputs=[IO.Custom(KreaIO.STYLE_REF).Output(display_name=\"style_reference\")],\n            hidden=[\n                IO.Hidden.auth_token_comfy_org,\n                IO.Hidden.api_key_comfy_org,\n                IO.Hidden.unique_id,\n            ],\n        )\n\n    @classmethod\n    async def execute(\n        cls,\n        image: Input.Image,\n        strength: float,\n        style_reference: list[dict] | None = None,\n    ) -> IO.NodeOutput:\n        chain: list[dict] = list(style_reference) if style_reference else []\n        if len(chain) >= 10:\n            raise ValueError(\"Krea 2 accepts at most 10 image_style_references in one generation.\")\n        url = await _upload_image_to_krea_assets(cls, image)\n        chain.append({\"url\": url, \"strength\": float(strength)})\n        return IO.NodeOutput(chain)\n\n\nclass KreaExtension(ComfyExtension):\n    @override\n    async def get_node_list(self) -> list[type[IO.ComfyNode]]:\n        return [\n            Krea2ImageNode,\n            Krea2StyleReferenceNode,\n        ]\n\n\nasync def comfy_entrypoint() -> KreaExtension:\n    return KreaExtension()\n","sourceCodeStart":260,"sourceCodeEnd":295,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_krea.py#L260-L295","documentation":"Client-side ValueError from Krea2StyleReferenceNode: the accumulated style-reference chain already has 10 entries, so appending one more would exceed Krea 2's per-generation limit of 10 image_style_references. The check uses >= 10 before appending, capping the chain at 10 total.","triggerScenarios":"Chaining a Krea2StyleReferenceNode whose style_reference input already carries 10 entries — i.e. an 11th reference is being added to the list passed between these nodes.","commonSituations":"Autogrow chains of style-reference nodes built by duplicating nodes in the graph; feeding a previously-completed 10-entry chain back into another reference node to add 'just one more'.","solutions":["Stop at 10 style-reference nodes; remove or bypass the 11th.","Rebalance: delete low-strength references and re-add only the ones that matter.","Route additional styling through a moodboard (moodboard_id) which is separate from the reference cap."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"chain = list(style_reference) if style_reference else []\nif len(chain) >= 10:\n    raise ValueError(\"Style-reference chain is full (10); remove one before adding another\")","typeGuard":"def can_append_style_ref(chain: list[dict]) -> bool:\n    return len(chain) < 10","tryCatchPattern":null,"preventionTips":["Treat 10 as a hard budget when designing style chains.","Display the running count in custom UIs if you build dynamic chains.","Route overflow styling to a moodboard."],"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"}