Skip to content

Commit c97e92c

Browse files
committed
1.13.2
1 parent 26eb5ab commit c97e92c

File tree

3 files changed

+102
-5
lines changed

3 files changed

+102
-5
lines changed

β€Žlora_lib.jsonβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
"Krea_lora_128.safetensors": "https://huggingface.co/StableDiffusionVN/Flux/blob/main/Lora/Krea_lora_128.safetensors",
2929
"Krea_lora_256.safetensors": "https://huggingface.co/StableDiffusionVN/Flux/blob/main/Lora/Krea_lora_256.safetensors",
3030
"Krea_lora_32.safetensors": "https://huggingface.co/StableDiffusionVN/Flux/blob/main/Lora/Krea_lora_32.safetensors",
31-
"Qwen-Image-Lightning-8steps-V1.1.safetensors": "https://huggingface.co/lightx2v/Qwen-Image-Lightning/blob/main/Qwen-Image-Lightning-8steps-V1.1.safetensors",
31+
"Qwen-Image-Lightning-8steps.safetensors": "https://huggingface.co/lightx2v/Qwen-Image-Lightning/blob/main/Qwen-Image-Lightning-8steps-V1.1.safetensors",
3232
"Qwen-Image-Lightning-4steps.safetensors": "https://huggingface.co/lightx2v/Qwen-Image-Lightning/blob/main/Qwen-Image-Lightning-4steps-V1.0-bf16.safetensors",
33-
"Qwen-Image_Union_diffsynth_lora.safetensors": "https://huggingface.co/Comfy-Org/Qwen-Image-DiffSynth-ControlNets/blob/main/split_files/loras/qwen_image_union_diffsynth_lora.safetensors"
33+
"Qwen-Image_Union_diffsynth_lora.safetensors": "https://huggingface.co/Comfy-Org/Qwen-Image-DiffSynth-ControlNets/blob/main/split_files/loras/qwen_image_union_diffsynth_lora.safetensors",
34+
"Qwen-Image-Edit-Lightning-4steps.safetensors": "https://huggingface.co/lightx2v/Qwen-Image-Lightning/blob/main/Qwen-Image-Edit-Lightning-4steps-V1.0.safetensors",
35+
"Qwen-Image-Edit-Lightning-8steps.safetensors": "https://huggingface.co/lightx2v/Qwen-Image-Lightning/blob/main/Qwen-Image-Edit-Lightning-8steps-V1.0.safetensors"
3436
}

β€Žnode/load.pyβ€Ž

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,98 @@ def apply_controlnet(self, image, control_net, preprocessor, union_type, resolut
926926
results["result"] = (p, n, image, para)
927927
return results
928928

929-
class Inpaint:
929+
class DiffsynthControlNetApply:
930+
model_lib_path = os.path.join(os.path.dirname(os.path.dirname(__file__)),"model_lib_any.json")
931+
with open(model_lib_path, 'r') as json_file:
932+
modellist = json.load(json_file)
933+
list_model_patches_model = []
934+
for key, value in modellist.items():
935+
if value[1] == "ModelPatch":
936+
list_model_patches_model.append(key)
937+
list_full_model_patches_model = list(set(folder_paths.get_filename_list("model_patches") + list_model_patches_model))
938+
list_full_model_patches_model.sort()
939+
@classmethod
940+
def INPUT_TYPES(s):
941+
return {"required": {
942+
"model": ("MODEL", {"tooltip": "Mô hình diffusion"}),
943+
"vae": ("VAE", {"tooltip": "Mô hình VAE"}),
944+
"image": ("IMAGE", {"tooltip": "αΊ’nh Δ‘αΊ§u vΓ o cho ControlNet."}),
945+
"model_patch": (none2list(s.list_full_model_patches_model),{"tooltip": "Chọn model ControlNet, mα»™t sα»‘ model cΓ³ trong danh sΓ‘ch tαΊ£i xuα»‘ng tα»± Δ‘α»™ng."}),
946+
"preprocessor": (preprocessor_list(),{"tooltip": "Tiền xα»­ lΓ½ αΊ£nh cho ControlNet, cαΊ§n cΓ i Δ‘αΊ·t ControlNet Aux."}),
947+
"resolution": ("INT", {"default": 1024, "min": 512, "max": 2048, "step": 1, "tooltip": "Độ phΓ’n giαΊ£i cho preprocessor."}),
948+
"strength": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step": 0.01, "tooltip": "Mα»©c Δ‘α»™ αΊ£nh hưởng cα»§a ControlNet lΓͺn αΊ£nh sinh ra."}),
949+
},
950+
"optional": {
951+
"mask": ("MASK", {"tooltip": "Mask dΓΉng cho ControlNet inpaint"}),
952+
}
953+
}
954+
955+
RETURN_TYPES = ("MODEL", "LATENT",)
956+
RETURN_NAMES = ("model", "latent",)
957+
FUNCTION = "apply_controlnet"
958+
959+
CATEGORY = "πŸ“‚ SDVN"
960+
961+
def apply_controlnet(self, model, vae, image, model_patch, preprocessor, resolution, strength, mask = None):
962+
if preprocessor == "InvertImage":
963+
image = ALL_NODE["ImageInvert"]().invert(image)[0]
964+
elif preprocessor != "None":
965+
if "AIO_Preprocessor" in ALL_NODE:
966+
r = ALL_NODE["AIO_Preprocessor"]().execute(preprocessor, image, resolution)
967+
if "result" in r:
968+
image = r["result"][0]
969+
else:
970+
image = r[0]
971+
else:
972+
print(
973+
"You have not installed it yet Controlnet Aux (https://github.com/Fannovel16/comfyui_controlnet_aux)")
974+
image = UpscaleImage().upscale("Maxsize", resolution, resolution, 1, "None", image)[0]
975+
model_patch = ALL_NODE["SDVN AnyDownload List"]().any_download_list(model_patch)[0]
976+
model = ALL_NODE["QwenImageDiffsynthControlnet"]().diffsynth_controlnet( model, model_patch, vae, image, strength, mask)[0]
977+
latent = ALL_NODE["VAEEncode"]().encode(vae, image)[0]
978+
results = ALL_NODE["PreviewImage"]().save_images(image)
979+
results["result"] = (model, latent)
980+
return results
981+
982+
class DiffsynthUnionLoraApply:
983+
@classmethod
984+
def INPUT_TYPES(s):
985+
return {"required": {
986+
"conditioning": ("CONDITIONING", {"tooltip": "CΓ’u lệnh để chαΊ‘y reference image"}),
987+
"vae": ("VAE", {"tooltip": "Mô hình VAE"}),
988+
"image": ("IMAGE", {"tooltip": "αΊ’nh Δ‘αΊ§u vΓ o cho ControlNet."}),
989+
"preprocessor": (preprocessor_list(),{"tooltip": "Tiền xα»­ lΓ½ αΊ£nh cho ControlNet, cαΊ§n cΓ i Δ‘αΊ·t ControlNet Aux."}),
990+
"resolution": ("INT", {"default": 1024, "min": 512, "max": 2048, "step": 1, "tooltip": "Độ phΓ’n giαΊ£i cho preprocessor."}),
991+
},
992+
}
993+
994+
RETURN_TYPES = ("CONDITIONING", "LATENT",)
995+
RETURN_NAMES = ("conditioning", "latent",)
996+
FUNCTION = "apply_controlnet"
997+
998+
CATEGORY = "πŸ“‚ SDVN"
999+
1000+
def apply_controlnet(self, conditioning, vae, image, preprocessor, resolution):
1001+
if preprocessor == "InvertImage":
1002+
image = ALL_NODE["ImageInvert"]().invert(image)[0]
1003+
elif preprocessor != "None":
1004+
if "AIO_Preprocessor" in ALL_NODE:
1005+
r = ALL_NODE["AIO_Preprocessor"]().execute(preprocessor, image, resolution)
1006+
if "result" in r:
1007+
image = r["result"][0]
1008+
else:
1009+
image = r[0]
1010+
else:
1011+
print(
1012+
"You have not installed it yet Controlnet Aux (https://github.com/Fannovel16/comfyui_controlnet_aux)")
1013+
image = UpscaleImage().upscale("Maxsize", resolution, resolution, 1, "None", image)[0]
1014+
latent = ALL_NODE["VAEEncode"]().encode(vae, image)[0]
1015+
conditioning = ALL_NODE["ReferenceLatent"]().append(conditioning, latent)[0]
1016+
results = ALL_NODE["PreviewImage"]().save_images(image)
1017+
results["result"] = (conditioning, latent)
1018+
return results
1019+
1020+
class Inpaint:
9301021
@classmethod
9311022
def INPUT_TYPES(s):
9321023
return {"required": {"SetLatentNoiseMask":("BOOLEAN",),
@@ -1605,6 +1696,8 @@ def any_download_list(s, Model):
16051696
"SDVN Load Image Ultimate": LoadImageUltimate,
16061697
"SDVN CLIP Text Encode": CLIPTextEncode,
16071698
"SDVN Controlnet Apply": AutoControlNetApply,
1699+
"SDVN DiffsynthControlNet Apply": DiffsynthControlNetApply,
1700+
"SDVN DiffsynthUnionLora Apply": DiffsynthUnionLoraApply,
16081701
"SDVN Inpaint": Inpaint,
16091702
"SDVN Apply Style Model": ApplyStyleModel,
16101703
"SDVN KSampler": Easy_KSampler,
@@ -1643,6 +1736,8 @@ def any_download_list(s, Model):
16431736
"SDVN CLIP Text Encode": "πŸ”‘ CLIP Text Encode",
16441737
"SDVN KSampler": "βŒ›οΈ KSampler",
16451738
"SDVN Controlnet Apply": "🎚️ Controlnet Apply",
1739+
"SDVN DiffsynthControlNet Apply": "🎚️ DiffsynthControlNet Apply",
1740+
"SDVN DiffsynthUnionLora Apply": "🎚️ DiffsynthUnionLora Apply",
16461741
"SDVN Inpaint": "πŸ‘¨β€πŸŽ¨ Inpaint",
16471742
"SDVN Apply Style Model": "🌈 Apply Style Model",
16481743
"SDVN Apply Kontext Reference": "🌈 Apply Kontext Reference",

β€Žpyproject.tomlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "sdvn_comfy_node"
3-
description = "Update Support Dynamic Prompts, fix bug"
4-
version = "1.13.1"
3+
description = "Update Support controlnet Qwen"
4+
version = "1.13.2"
55
license = {file = "LICENSE"}
66
dependencies = ["#If MacOs - Please install aria2 manually via brew", "aria2;sys_platform != 'darwin'", "openai", "gallery-dl", "google-generativeai", "googletrans-py"]
77

0 commit comments

Comments
Β (0)