File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 223223 "cosmos-2.0-v2w-14B" : {"pretrained_model_name_or_path" : "nvidia/Cosmos-Predict2-14B-Video2World" },
224224 "z-image-turbo" : {"pretrained_model_name_or_path" : "Tongyi-MAI/Z-Image-Turbo" },
225225 "z-image-turbo-controlnet" : {"pretrained_model_name_or_path" : "hlky/Z-Image-Turbo-Fun-Controlnet-Union" },
226- "z-image-turbo-controlnet-2.x" : {"pretrained_model_name_or_path" : "hlky/Z-Image-Turbo-Fun-Controlnet-Union-2.1" },
226+ "z-image-turbo-controlnet-2.0" : {"pretrained_model_name_or_path" : "hlky/Z-Image-Turbo-Fun-Controlnet-Union-2.0" },
227+ "z-image-turbo-controlnet-2.1" : {"pretrained_model_name_or_path" : "hlky/Z-Image-Turbo-Fun-Controlnet-Union-2.1" },
227228}
228229
229230# Use to configure model sample size when original config is provided
@@ -784,7 +785,10 @@ def infer_diffusers_model_type(checkpoint):
784785 raise ValueError (f"Unexpected x_embedder shape: { x_embedder_shape } when loading Cosmos 2.0 model." )
785786
786787 elif CHECKPOINT_KEY_NAMES ["z-image-turbo-controlnet-2.x" ] in checkpoint :
787- model_type = "z-image-turbo-controlnet-2.x"
788+ if torch .all (checkpoint ["control_noise_refiner.0.before_proj.weight" ] == 0.0 ):
789+ model_type = "z-image-turbo-controlnet-2.0"
790+ else :
791+ model_type = "z-image-turbo-controlnet-2.1"
788792
789793 elif CHECKPOINT_KEY_NAMES ["z-image-turbo-controlnet" ] in checkpoint :
790794 model_type = "z-image-turbo-controlnet"
Original file line number Diff line number Diff line change 5858 >>> # torch_dtype=torch.bfloat16,
5959 >>> # )
6060
61- >>> # 2.0 - `config` is required
61+ >>> # 2.0
6262 >>> # controlnet = ZImageControlNetModel.from_single_file(
6363 >>> # hf_hub_download(
6464 >>> # "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union-2.0",
6565 >>> # filename="Z-Image-Turbo-Fun-Controlnet-Union-2.0.safetensors",
6666 >>> # ),
6767 >>> # torch_dtype=torch.bfloat16,
68- >>> # config="hlky/Z-Image-Turbo-Fun-Controlnet-Union-2.0",
6968 >>> # )
7069
7170 >>> pipe = ZImageControlNetPipeline.from_pretrained(
Original file line number Diff line number Diff line change 5050 ... torch_dtype=torch.bfloat16,
5151 ... )
5252
53- >>> # 2.0 - `config` is required
53+ >>> # 2.0
5454 >>> # controlnet = ZImageControlNetModel.from_single_file(
5555 >>> # hf_hub_download(
5656 >>> # "alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union-2.0",
5757 >>> # filename="Z-Image-Turbo-Fun-Controlnet-Union-2.0.safetensors",
5858 >>> # ),
5959 >>> # torch_dtype=torch.bfloat16,
60- >>> # config="hlky/Z-Image-Turbo-Fun-Controlnet-Union-2.0",
6160 >>> # )
6261
6362 >>> pipe = ZImageControlNetInpaintPipeline.from_pretrained(
You can’t perform that action at this time.
0 commit comments