Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Dynamically detect chroma radiance patch size (#11991)

Myloc4a14df9a353
diff --git a/comfy/model_detection.py b/comfy/model_detection.py
index 42884f797..dad206a2f 100644
--- a/comfy/model_detection.py
+++ b/comfy/model_detection.py
@@ -253,7 +253,7 @@ def detect_unet_config(state_dict, key_prefix, metadata=None):
dit_config["image_model"] = "chroma_radiance"
dit_config["in_channels"] = 3
dit_config["out_channels"] = 3
- dit_config["patch_size"] = 16
+ dit_config["patch_size"] = state_dict.get('{}img_in_patch.weight'.format(key_prefix)).size(dim=-1)
dit_config["nerf_hidden_size"] = 64
dit_config["nerf_mlp_ratio"] = 4
dit_config["nerf_depth"] = 4