{"record":{"id":"23dd5d1a1b608b17","repo":"Comfy-Org/ComfyUI","slug":"invalid-query","errorCode":"INVALID_QUERY","errorMessage":"metadata_filter must be JSON: {e}","messagePattern":"metadata_filter must be JSON: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"app/assets/api/schemas_in.py","lineNumber":105,"sourceCode":"            return [t.strip() for t in v.split(\",\") if t.strip()]\n        if isinstance(v, list):\n            out: list[str] = []\n            for item in v:\n                if isinstance(item, str):\n                    out.extend([t.strip() for t in item.split(\",\") if t.strip()])\n            return out\n        return v\n\n    @field_validator(\"metadata_filter\", mode=\"before\")\n    @classmethod\n    def _parse_metadata_json(cls, v):\n        if v is None or isinstance(v, dict):\n            return v\n        if isinstance(v, str) and v.strip():\n            try:\n                parsed = json.loads(v)\n            except Exception as e:\n                raise ValueError(f\"metadata_filter must be JSON: {e}\") from e\n            if not isinstance(parsed, dict):\n                raise ValueError(\"metadata_filter must be a JSON object\")\n            return parsed\n        return None\n\n\nclass UpdateAssetBody(BaseModel):\n    name: str | None = None\n    user_metadata: dict[str, Any] | None = None\n    preview_id: str | None = None  # references an asset_reference id, not an asset id\n\n    @model_validator(mode=\"after\")\n    def _validate_at_least_one_field(self):\n        if all(\n            v is None\n            for v in (self.name, self.user_metadata, self.preview_id)\n        ):\n            raise ValueError(","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/app/assets/api/schemas_in.py#L87-L123","documentation":"Raised by LatentBlend.blend_mode when the blend_mode string passed to LatentBlend.blend is anything other than \"normal\". The blend method's Python signature accepts any string (blend_mode: str = \"normal\") and the UI combo does not enumerate the extra modes, so this guard exists to reject values the implementation never handles. The node only implements the \"normal\" blend (which simply returns img2 before the factor mix).","triggerScenarios":"Calling LatentBlend.blend programmatically (API prompt or custom node) with blend_mode set to e.g. \"multiply\", \"screen\", or any non-default string; a saved workflow or frontend extension exposing blend-mode options that the node implementation does not support; typos like \"Normal\" (case-sensitive check).","commonSituations":"Custom scripts building API prompts that assume image-editor blend modes exist on the latent blend node; third-party UI extensions adding a blend-mode dropdown with unsupported values; porting workflows between forks where LatentBlend gained modes but upstream never did.","solutions":["Omit blend_mode entirely (it defaults to \"normal\") or set it to exactly \"normal\" — lowercase, exact match.","If you need other blend behaviors, implement them yourself on the LATENT tensors before/after LatentBlend, or use a dedicated compositing node.","Audit API prompts and custom frontends for hardcoded blend_mode strings and remove or correct them."],"exampleFix":"# before\nresult = latent_blend.blend(samples1, samples2, 0.5, blend_mode=\"multiply\")\n\n# after\nresult = latent_blend.blend(samples1, samples2, 0.5)  # blend_mode defaults to \"normal\"","handlingStrategy":"validation","validationCode":"SUPPORTED_BLEND_MODES = {\"normal\"}\n\ndef blend_mode_ok(mode: str) -> bool:\n    return mode in SUPPORTED_BLEND_MODES","typeGuard":"def is_supported_blend_mode(mode: str) -> bool:\n    return isinstance(mode, str) and mode == \"normal\"","tryCatchPattern":"try:\n    out = latent_blend.blend(samples1, samples2, blend_factor, blend_mode)\nexcept ValueError as e:\n    if \"Unsupported blend mode\" in str(e):\n        out = latent_blend.blend(samples1, samples2, blend_factor)  # fall back to \"normal\"\n    else:\n        raise","preventionTips":["Omit blend_mode in API prompts unless you explicitly pass \"normal\".","Treat the node's combo/default as the source of truth; do not invent mode names.","For non-normal blending, precompute blended LATENT tensors in your own node instead of passing unsupported strings."],"tags":["comfyui","latent-blend","invalid-argument","api-prompt"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}