{"record":{"id":"70f760a8664066ed","repo":"Comfy-Org/ComfyUI","slug":"unsupported-pid-v1-5-latent-projection-with-laten","errorCode":null,"errorMessage":"Unsupported PiD v1.5 latent projection with {latent_proj_in_channels} input channels","messagePattern":"Unsupported PiD v1\\.5 latent projection with (.+?) input channels","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy/model_detection.py","lineNumber":535,"sourceCode":"                      \"lq_hidden_dim\": hidden_dim}\n        if num_gates > 0:\n            dit_config[\"lq_interval\"] = (14 + num_gates - 1) // num_gates\n        if pid_v1_5:\n            pid_v1_5_variants = {\n                16: {  # Flux and QwenImage\n                    \"lq_latent_channels\": 16,\n                    \"latent_spatial_down_factor\": 8,\n                    \"lq_latent_unpatchify_factor\": 1,\n                },\n                32: {  # Flux2 after 2x latent unpatchify\n                    \"lq_latent_channels\": 128,\n                    \"latent_spatial_down_factor\": 16,\n                    \"lq_latent_unpatchify_factor\": 2,\n                },\n            }\n            variant = pid_v1_5_variants.get(latent_proj_in_channels)\n            if variant is None:\n                raise ValueError(f\"Unsupported PiD v1.5 latent projection with {latent_proj_in_channels} input channels\")\n            gate_weight = state_dict['{}lq_proj.gate_modules.0.content_proj.weight'.format(key_prefix)]\n            dit_config.update(variant)\n            dit_config.update({\n                \"lq_conv_padding_mode\": \"replicate\",\n                \"lq_gate_per_token\": gate_weight.shape[0] == 1,\n                \"pit_lq_inject\": True,\n                \"rope_ref_h\": 2048,\n                \"rope_ref_w\": 2048,\n            })\n        else:\n            dit_config.update({\n                \"lq_latent_channels\": latent_proj_in_channels,\n                \"latent_spatial_down_factor\": 16 if latent_proj_in_channels >= 64 else 8,\n            })\n        return dit_config\n\n    if '{}core.pixel_embedder.proj.weight'.format(key_prefix) in state_dict_keys:  # PixelDiT T2I\n        return {\"image_model\": \"pixeldit_t2i\"}","sourceCodeStart":517,"sourceCodeEnd":553,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/model_detection.py#L517-L553","documentation":"PiD v1.5 model detection recognizes only specific latent projection input-channel counts (16 for the standard latent, 32 for Flux2 after 2x latent unpatchify); the variants dict lookup returns None for any other count and detection aborts. Any other channel count means the checkpoint is a PiD variant this ComfyUI version does not know.","triggerScenarios":"Loading a checkpoint whose lq_proj input channels are neither of the supported values — e.g. a newer PiD release, a re-quantized/re-chopped checkpoint, or a corrupted state dict read as a weird channel count.","commonSituations":"New PiD v1.5 checkpoint variant shipped after the ComfyUI version in use; a community re-export that changed the latent projection; mixing up which projection layer triggered detection.","solutions":["Update ComfyUI to the latest version that may have added the variant.","Re-download the checkpoint from the original release to rule out corruption.","If it is a genuinely new variant, it needs code support (a new entry in pid_v1_5_variants) — report it upstream."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"SUPPORTED_PID_CHANNELS = {16, 32}\nin_ch = state_dict[f\"{key_prefix}lq_proj.in_weight\"].shape[1] if f\"{key_prefix}lq_proj.in_weight\" in state_dict else None\nif in_ch is not None and in_ch not in SUPPORTED_PID_CHANNELS:\n    logging.warning(\"PiD checkpoint has unsupported latent proj channels %s; load may fail\", in_ch)","typeGuard":null,"tryCatchPattern":"try:\n    model = comfy.sd.load_diffusion_model(ckpt_path)\nexcept ValueError as e:\n    if \"PiD v1.5 latent projection\" in str(e):\n        raise RuntimeError(\"Unsupported PiD variant; update ComfyUI or use an official checkpoint\") from e\n    raise","preventionTips":["Download PiD checkpoints from official releases only.","Keep ComfyUI updated when new PiD variants ship.","Avoid community re-exports that alter the latent projection."],"tags":["model-detection","pid","checkpoint","channels"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}