{"record":{"id":"11ab319642a4d816","repo":"Comfy-Org/ComfyUI","slug":"scalar-feature-is-not-implemented-yet","errorCode":null,"errorMessage":"Scalar feature is not implemented yet.","messagePattern":"Scalar feature is not implemented yet\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"comfy/ldm/cosmos/model.py","lineNumber":384,"sourceCode":"            data_type, DataType\n        ), f\"Expected DataType, got {type(data_type)}. We need discuss this flag later.\"\n        original_shape = x.shape\n        x_B_T_H_W_D, rope_emb_L_1_1_D, extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D = self.prepare_embedded_sequence(\n            x,\n            fps=fps,\n            padding_mask=padding_mask,\n            latent_condition=latent_condition,\n            latent_condition_sigma=latent_condition_sigma,\n        )\n        # logging affline scale information\n        affline_scale_log_info = {}\n\n        timesteps_B_D, adaln_lora_B_3D = self.t_embedder[1](self.t_embedder[0](timesteps.flatten()).to(x.dtype))\n        affline_emb_B_D = timesteps_B_D\n        affline_scale_log_info[\"timesteps_B_D\"] = timesteps_B_D.detach()\n\n        if scalar_feature is not None:\n            raise NotImplementedError(\"Scalar feature is not implemented yet.\")\n\n        affline_scale_log_info[\"affline_emb_B_D\"] = affline_emb_B_D.detach()\n        affline_emb_B_D = self.affline_norm(affline_emb_B_D)\n\n        if self.use_cross_attn_mask:\n            if crossattn_mask is not None and not torch.is_floating_point(crossattn_mask):\n                crossattn_mask = (crossattn_mask - 1).to(x.dtype) * torch.finfo(x.dtype).max\n            crossattn_mask = crossattn_mask[:, None, None, :]  # .to(dtype=torch.bool)  # [B, 1, 1, length]\n        else:\n            crossattn_mask = None\n\n        if self.blocks[\"block0\"].x_format == \"THWBD\":\n            x = rearrange(x_B_T_H_W_D, \"B T H W D -> T H W B D\")\n            if extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D is not None:\n                extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D = rearrange(\n                    extra_pos_emb_B_T_H_W_D_or_T_H_W_B_D, \"B T H W D -> T H W B D\"\n                )\n            crossattn_emb = rearrange(crossattn_emb, \"B M D -> M B D\")","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/ldm/cosmos/model.py#L366-L402","documentation":"The Cosmos model forward() accepts an optional scalar_feature tensor, but the code path is intentionally unimplemented: passing anything other than None immediately raises NotImplementedError. Scalar (per-timestep conditioning vector) features from upstream NVIDIA Cosmos configs are simply not wired into this ComfyUI port.","triggerScenarios":"Calling the Cosmos model forward with scalar_feature as a non-None tensor, e.g. when a custom node forwards upstream model kwargs verbatim and the checkpoint config declares scalar features (some Cosmos predict/video-world-model variants).","commonSituations":"Porting a Cosmos variant that uses scalar conditioning (e.g. camera or motion scalar inputs); a custom node that passes a conditioning dict through as **kwargs without filtering unsupported keys.","solutions":["Do not pass scalar_feature; forward only timesteps, x, and crossattn/latent conditioning that this model consumes.","If porting a Cosmos variant that needs scalar features, extend forward() yourself (embed scalar_feature and add it to affline_emb_B_D) — no stock path supports it.","Filter unknown conditioning keys at the custom-node boundary instead of forwarding upstream kwargs blindly."],"exampleFix":"# before\nout = model(x, timesteps, scalar_feature=feat, **upstream_kwargs)\n\n# after\nkwargs = {k: v for k, v in upstream_kwargs.items() if k != \"scalar_feature\"}\nout = model(x, timesteps, **kwargs)","handlingStrategy":"validation","validationCode":"kwargs.pop(\"scalar_feature\", None)  # unsupported conditioning key; never forward it\nout = model(x, timesteps, **kwargs)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Filter conditioning kwargs at the node boundary instead of forwarding upstream model kwargs verbatim.","Treat NotImplementedError from model forwards as an API contract signal: the input is not supported, do not retry."],"tags":["cosmos","not-implemented","forward","conditioning"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}