{"record":{"id":"2c03d74cae1cc485","repo":"Comfy-Org/ComfyUI","slug":"unknown-krea-2-model-model-choice-r","errorCode":null,"errorMessage":"Unknown Krea 2 model: {model_choice!r}","messagePattern":"Unknown Krea 2 model: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"comfy_api_nodes/nodes_krea.py","lineNumber":184,"sourceCode":"                  {\"type\":\"usd\",\"usd\": $usd}\n                )\n                \"\"\",\n            ),\n        )\n\n    @classmethod\n    async def execute(\n        cls,\n        prompt: str,\n        model: dict,\n        seed: int,\n    ) -> IO.NodeOutput:\n        validate_string(prompt, strip_whitespace=False, min_length=1)\n\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(","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_krea.py#L166-L202","documentation":"Client-side ValueError thrown when the Krea 2 image node's model dict contains a 'model' key not present in the _MODEL_ENDPOINTS mapping. The node cannot map the choice to a proxy endpoint path, so it refuses before any request is made.","triggerScenarios":"Executing Krea2ImageNode with model['model'] set to a stale/typo'd value — e.g. a workflow saved with an older widget value after the node's model list changed, or a workflow hand-edited so the combo value no longer matches any _MODEL_ENDPOINTS key.","commonSituations":"Loading old workflows after a comfy_api_nodes update renamed Krea model identifiers; frontend combo and backend mapping out of sync after a partial update; serialized workflow JSON edited manually.","solutions":["Re-select the model in the Krea 2 node's dropdown and re-save the workflow so the widget value matches current options.","Update comfy_api_nodes to the latest version so _MODEL_ENDPOINTS covers the model name in the workflow.","If the model is genuinely new/missing, open an issue to add it to _MODEL_ENDPOINTS."],"exampleFix":"// before\nmodel = {\"model\": \"krea-2-preview-old-name\", ...}\n// after\nmodel = {\"model\": \"krea-2-pro\", ...}  # a key present in _MODEL_ENDPOINTS","handlingStrategy":"type-guard","validationCode":"from comfy_api_nodes.nodes_krea import _MODEL_ENDPOINTS\nif model[\"model\"] not in _MODEL_ENDPOINTS:\n    raise ValueError(f\"Pick one of {sorted(_MODEL_ENDPOINTS)}\")","typeGuard":"def is_known_krea_model(model: dict) -> bool:\n    return model.get(\"model\") in _MODEL_ENDPOINTS","tryCatchPattern":null,"preventionTips":["Re-select combo widgets after updating comfy_api_nodes.","Prefer re-picking values in the UI over hand-editing workflow JSON.","Pin node-pack versions for archived workflows."],"tags":["krea","api-nodes","validation","model-selection","pre-flight"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}