{"record":{"id":"8c236dc7a3fe9adf","repo":"sgl-project/sglang","slug":"hunyuan3d-paint-does-not-use-added-conditioning","errorCode":null,"errorMessage":"Hunyuan3D Paint does not use added conditioning.","messagePattern":"Hunyuan3D Paint does not use added conditioning\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/models/dits/hunyuan3d_paint.py","lineNumber":327,"sourceCode":"        ref_latents: torch.Tensor,\n        num_in_batch: int,\n        condition_embed_dict: dict[str, torch.Tensor],\n        normal_imgs: torch.Tensor | None = None,\n        position_imgs: torch.Tensor | None = None,\n        camera_info_gen: torch.Tensor,\n        camera_info_ref: torch.Tensor,\n        ref_scale: float | torch.Tensor = 1.0,\n        mva_scale: float | torch.Tensor = 1.0,\n        position_attn_mask: dict[int, torch.Tensor] | None = None,\n        timestep_cond: torch.Tensor | None = None,\n        cross_attention_kwargs: dict[str, Any] | None = None,\n        added_cond_kwargs: dict[str, torch.Tensor] | None = None,\n        return_dict: bool = True,\n    ) -> StableDiffusionUNetOutput | tuple[torch.Tensor]:\n        if timestep_cond is not None or cross_attention_kwargs is not None:\n            raise ValueError(\"Hunyuan3D Paint does not use extra UNet conditioning.\")\n        if added_cond_kwargs is not None:\n            raise ValueError(\"Hunyuan3D Paint does not use added conditioning.\")\n        batch_size, num_generated, _, height, width = sample.shape\n        if height != width or num_generated != num_in_batch:\n            raise ValueError(\n                \"Hunyuan3D Paint expects square latents and a matching view count.\"\n            )\n\n        camera_gen = rearrange(\n            camera_info_gen + self.max_num_ref_images, \"b n -> (b n)\"\n        )\n        inputs = [sample]\n        if normal_imgs is not None:\n            inputs.append(normal_imgs)\n        if position_imgs is not None:\n            inputs.append(position_imgs)\n        sample = rearrange(torch.cat(inputs, dim=2), \"b n c h w -> (b n) c h w\")\n        encoder_gen = encoder_hidden_states.unsqueeze(1).repeat(1, num_generated, 1, 1)\n        encoder_gen = rearrange(encoder_gen, \"b n l c -> (b n) l c\")\n","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/models/dits/hunyuan3d_paint.py#L309-L345","documentation":"The Hunyuan3D Paint UNet does not support diffusers 'added conditioning' (added_cond_kwargs such as text embeddings/score conditioning used by SDXL). forward raises this ValueError if added_cond_kwargs is passed, since its conditioning comes from camera info and multiview machinery instead.","triggerScenarios":"Calling the paint UNet forward with added_cond_kwargs (e.g. {'text_embeds': ..., 'time_ids': ...}), usually because a SDXL-style pipeline or copied sample code forwards it unconditionally.","commonSituations":"Reusing SDXL sampling code; a generic pipeline that always passes added_cond_kwargs even when None-checks are skipped.","solutions":["Omit added_cond_kwargs (or pass None) when calling this UNet","Use the provided Hunyuan3D Paint pipeline instead of an SDXL one","Guard your sampler: only forward added_cond_kwargs when the UNet supports it"],"exampleFix":"# before\nnoise_pred = unet(sample, t, added_cond_kwargs={\"text_embeds\": te, \"time_ids\": ti})\n\n# after\nnoise_pred = unet(sample, t)","handlingStrategy":"validation","validationCode":"assert added_cond_kwargs is None, 'paint UNet does not accept added_cond_kwargs'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't reuse SDXL sampler code with this UNet","Centralize UNet invocation in one helper that knows the accepted args"],"tags":["runtime","api-misuse","diffusion","unet"],"backgroundTag":"unsupported-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}