{"record":{"id":"081bb4498350beaf","repo":"Comfy-Org/ComfyUI","slug":"unknown-key-s-in-transformer-options-chroma-radia","errorCode":null,"errorMessage":"Unknown key(s) in transformer_options chroma_radiance_options: {', '.join(bad_keys)}","messagePattern":"Unknown key\\(s\\) in transformer_options chroma_radiance_options: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/chroma_radiance/model.py","lineNumber":274,"sourceCode":"            # pass through the dynamic MLP blocks (the NeRF)\n            for block in self.nerf_blocks:\n                img_dct_tile = block(img_dct_tile, nerf_hidden_tile)\n\n            output_tiles.append(img_dct_tile)\n\n        # Concatenate the processed tiles along the patch dimension\n        return torch.cat(output_tiles, dim=0)\n\n    def radiance_get_override_params(self, overrides: dict) -> ChromaRadianceParams:\n        params = self.params\n        if not overrides:\n            return params\n        params_dict = {k: getattr(params, k) for k in params.__dataclass_fields__}\n        nullable_keys = frozenset((\"nerf_embedder_dtype\",))\n        bad_keys = tuple(k for k in overrides if k not in params_dict)\n        if bad_keys:\n            e = f\"Unknown key(s) in transformer_options chroma_radiance_options: {', '.join(bad_keys)}\"\n            raise ValueError(e)\n        bad_keys = tuple(\n            k\n            for k, v in overrides.items()\n            if not isinstance(v, type(getattr(params, k))) and (v is not None or k not in nullable_keys)\n        )\n        if bad_keys:\n            e = f\"Invalid value(s) in transformer_options chroma_radiance_options: {', '.join(bad_keys)}\"\n            raise ValueError(e)\n        # At this point it's all valid keys and values so we can merge with the existing params.\n        params_dict |= overrides\n        return params.__class__(**params_dict)\n\n    def _apply_x0_residual(self, predicted, noisy, timesteps):\n\n        # non zero during training to prevent 0 div\n        eps = 0.0\n        return (noisy - predicted) / (timesteps.view(-1,1,1,1) + eps)\n","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/chroma_radiance/model.py#L256-L292","documentation":"radiance_get_override_params merges user-supplied overrides from transformer_options['chroma_radiance_options'] into a copy of the model's ChromaRadianceParams. It first builds the set of valid keys from the dataclass fields; any override key not in that set is collected into bad_keys and raises ValueError listing the unknown names. This guards against silently ignoring typos in option names (e.g. 'patch_sze'), which would make users believe an option took effect.","triggerScenarios":"Passing chroma_radiance_options in transformer_options with a misspelled or unsupported key, e.g. {'tile_hight': 512} or a key that only exists on Chroma but not ChromaRadianceParams. The merge happens every forward pass in _forward, so the error surfaces at the first sampling step.","commonSituations":"Custom nodes or hand-written patches injecting radiance tiling options; copying option snippets between ComfyUI versions where the params dataclass gained/renamed fields; stale custom node using pre-rename key names.","solutions":["Read the error message: it lists exactly which keys are unknown; remove or correct them in chroma_radiance_options","Check ChromaRadianceParams fields in comfy/ldm/chroma_radiance/model.py for the valid key set in your ComfyUI version","Update the custom node that injects the options to match the current field names"],"exampleFix":"# before\ntransformer_options[\"chroma_radiance_options\"] = {\"tile_hight\": 512}\n\n# after\ntransformer_options[\"chroma_radiance_options\"] = {\"tile_height\": 512}","handlingStrategy":"validation","validationCode":"from dataclasses import fields\nvalid = {f.name for f in fields(type(model.params))}\nbad = set(options) - valid\nif bad:\n    raise ValueError(f\"Unknown chroma_radiance_options: {bad}; valid: {sorted(valid)}\")","typeGuard":"def filter_valid_options(options: dict, param_cls) -> dict:\n    valid = {f.name for f in dataclasses.fields(param_cls)}\n    return {k: v for k, v in options.items() if k in valid}","tryCatchPattern":"try:\n    model(x, t, context, transformer_options={\"chroma_radiance_options\": opts})\nexcept ValueError as e:\n    if \"Unknown key\" in str(e):\n        bad = set(opts) - {f.name for f in dataclasses.fields(type(model.params))}\n        opts = {k: v for k, v in opts.items() if k not in bad}\n    else:\n        raise","preventionTips":["Derive option keys from ChromaRadianceParams dataclass fields instead of hard-coding strings","Log the valid key set once at node startup so typos are caught early"],"tags":["chroma-radiance","transformer-options","validation","custom-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}