mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-26 22:30:19 +08:00
Merge branch 'comfyanonymous:master' into feature/preview-latent
This commit is contained in:
commit
1daa559a39
@ -1,14 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
supported_ckpt_extensions = set(['.ckpt', '.pth'])
|
supported_ckpt_extensions = set(['.ckpt', '.pth', '.safetensors'])
|
||||||
supported_pt_extensions = set(['.ckpt', '.pt', '.bin', '.pth'])
|
supported_pt_extensions = set(['.ckpt', '.pt', '.bin', '.pth', '.safetensors'])
|
||||||
try:
|
|
||||||
import safetensors.torch
|
|
||||||
supported_ckpt_extensions.add('.safetensors')
|
|
||||||
supported_pt_extensions.add('.safetensors')
|
|
||||||
except:
|
|
||||||
print("Could not import safetensors, safetensors support disabled.")
|
|
||||||
|
|
||||||
|
|
||||||
folder_names_and_paths = {}
|
folder_names_and_paths = {}
|
||||||
|
|
||||||
|
|||||||
9
nodes.py
9
nodes.py
@ -556,6 +556,9 @@ class LoraLoader:
|
|||||||
CATEGORY = "loaders"
|
CATEGORY = "loaders"
|
||||||
|
|
||||||
def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
|
def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
|
||||||
|
if strength_model == 0 and strength_clip == 0:
|
||||||
|
return (model, clip)
|
||||||
|
|
||||||
lora_path = folder_paths.get_full_path("loras", lora_name)
|
lora_path = folder_paths.get_full_path("loras", lora_name)
|
||||||
model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora_path, strength_model, strength_clip)
|
model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora_path, strength_model, strength_clip)
|
||||||
return (model_lora, clip_lora)
|
return (model_lora, clip_lora)
|
||||||
@ -637,6 +640,9 @@ class ControlNetApply:
|
|||||||
CATEGORY = "conditioning"
|
CATEGORY = "conditioning"
|
||||||
|
|
||||||
def apply_controlnet(self, conditioning, control_net, image, strength):
|
def apply_controlnet(self, conditioning, control_net, image, strength):
|
||||||
|
if strength == 0:
|
||||||
|
return (conditioning, )
|
||||||
|
|
||||||
c = []
|
c = []
|
||||||
control_hint = image.movedim(-1,1)
|
control_hint = image.movedim(-1,1)
|
||||||
for t in conditioning:
|
for t in conditioning:
|
||||||
@ -743,6 +749,9 @@ class unCLIPConditioning:
|
|||||||
CATEGORY = "conditioning"
|
CATEGORY = "conditioning"
|
||||||
|
|
||||||
def apply_adm(self, conditioning, clip_vision_output, strength, noise_augmentation):
|
def apply_adm(self, conditioning, clip_vision_output, strength, noise_augmentation):
|
||||||
|
if strength == 0:
|
||||||
|
return (conditioning, )
|
||||||
|
|
||||||
c = []
|
c = []
|
||||||
for t in conditioning:
|
for t in conditioning:
|
||||||
o = t[1].copy()
|
o = t[1].copy()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user