The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix some potential issues.
comfyanonymous430a8334c500
diff --git a/comfy/clip_vision.py b/comfy/clip_vision.pyindex 1206c680d..e085186ef 100644--- a/comfy/clip_vision.py+++ b/comfy/clip_vision.py@@ -92,8 +92,11 @@ def load_clipvision_from_sd(sd, prefix="", convert_keys=False):json_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "clip_vision_config_g.json")elif "vision_model.encoder.layers.30.layer_norm1.weight" in sd:json_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "clip_vision_config_h.json")- else:+ elif "vision_model.encoder.layers.22.layer_norm1.weight" in sd:json_config = os.path.join(os.path.dirname(os.path.realpath(__file__)), "clip_vision_config_vitl.json")+ else:+ return None+clip = ClipVisionModel(json_config)m, u = clip.load_sd(sd)if len(m) > 0:diff --git a/comfy/sd.py b/comfy/sd.pyindex 48ee5721b..c364b723c 100644--- a/comfy/sd.py+++ b/comfy/sd.py@@ -434,10 +434,11 @@ def load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, oif output_clip:w = WeightsLoader()clip_target = model_config.clip_target()- clip = CLIP(clip_target, embedding_directory=embedding_directory)- w.cond_stage_model = clip.cond_stage_model- sd = model_config.process_clip_state_dict(sd)- load_model_weights(w, sd)+ if clip_target is not None:+ clip = CLIP(clip_target, embedding_directory=embedding_directory)+ w.cond_stage_model = clip.cond_stage_model+ sd = model_config.process_clip_state_dict(sd)+ load_model_weights(w, sd)left_over = sd.keys()if len(left_over) > 0: