Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cfdd0b3f5 | ||
|
|
9c06cc666c | ||
|
|
710917d507 | ||
|
|
16f4312c9e | ||
|
|
20801f4d3f | ||
|
|
ba2f942b29 | ||
|
|
0dfa83f486 | ||
|
|
5954092f25 | ||
|
|
a2990ca833 | ||
|
|
d673c4a00b |
@@ -25,10 +25,10 @@ class ComfyUIDeployExternalLora:
|
|||||||
},
|
},
|
||||||
"optional": {
|
"optional": {
|
||||||
"default_lora_name": (folder_paths.get_filename_list("loras"),),
|
"default_lora_name": (folder_paths.get_filename_list("loras"),),
|
||||||
"lora_save_name": ( # if `default_lora_name` is a link to download a file, we will attempt to save it with this name
|
"lora_save_name": ( # if `default_lora_name` is a link to download a file, we will attempt to save it with this name
|
||||||
"STRING",
|
"STRING",
|
||||||
{"multiline": False, "default": ""},
|
{"multiline": False, "default": ""},
|
||||||
),
|
),
|
||||||
"display_name": (
|
"display_name": (
|
||||||
"STRING",
|
"STRING",
|
||||||
{"multiline": False, "default": ""},
|
{"multiline": False, "default": ""},
|
||||||
@@ -51,15 +51,7 @@ class ComfyUIDeployExternalLora:
|
|||||||
|
|
||||||
CATEGORY = "deploy"
|
CATEGORY = "deploy"
|
||||||
|
|
||||||
def run(
|
def run(self, input_id, default_lora_name=None, lora_save_name=None, display_name=None, description=None, lora_url=None):
|
||||||
self,
|
|
||||||
input_id,
|
|
||||||
default_lora_name=None,
|
|
||||||
lora_save_name=None,
|
|
||||||
display_name=None,
|
|
||||||
description=None,
|
|
||||||
lora_url=None,
|
|
||||||
):
|
|
||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
@@ -79,9 +71,9 @@ class ComfyUIDeployExternalLora:
|
|||||||
folder_paths.folder_names_and_paths["loras"][0][0], lora_save_name
|
folder_paths.folder_names_and_paths["loras"][0][0], lora_save_name
|
||||||
)
|
)
|
||||||
print(destination_path)
|
print(destination_path)
|
||||||
print("Downloading external lora - " + lora_url + " to " + destination_path)
|
print("Downloading external lora - " + input_id + " to " + destination_path)
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
lora_url,
|
input_id,
|
||||||
headers={"User-Agent": "Mozilla/5.0"},
|
headers={"User-Agent": "Mozilla/5.0"},
|
||||||
allow_redirects=True,
|
allow_redirects=True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -764,7 +764,7 @@ class ComfyUIDeployExternalVideo:
|
|||||||
"optional": {
|
"optional": {
|
||||||
"meta_batch": ("VHS_BatchManager",),
|
"meta_batch": ("VHS_BatchManager",),
|
||||||
"vae": ("VAE",),
|
"vae": ("VAE",),
|
||||||
"default_video": (sorted(files),),
|
"default_value": (sorted(files),),
|
||||||
"display_name": (
|
"display_name": (
|
||||||
"STRING",
|
"STRING",
|
||||||
{"multiline": False, "default": ""},
|
{"multiline": False, "default": ""},
|
||||||
@@ -834,7 +834,7 @@ class ComfyUIDeployExternalVideo:
|
|||||||
):
|
):
|
||||||
out_file.write(chunk)
|
out_file.write(chunk)
|
||||||
else:
|
else:
|
||||||
video = kwargs.get("default_video", None)
|
video = kwargs.get("default_value", "")
|
||||||
if video is None:
|
if video is None:
|
||||||
raise "No default video given and no external video provided"
|
raise "No default video given and no external video provided"
|
||||||
video_path = folder_paths.get_annotated_filepath(video.strip('"'))
|
video_path = folder_paths.get_annotated_filepath(video.strip('"'))
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
import folder_paths
|
|
||||||
from PIL import Image, ImageOps
|
|
||||||
import numpy as np
|
|
||||||
import torch
|
|
||||||
import folder_paths
|
|
||||||
from tqdm import tqdm
|
|
||||||
|
|
||||||
class AnyType(str):
|
|
||||||
def __ne__(self, __value: object) -> bool:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
WILDCARD = AnyType("*")
|
|
||||||
|
|
||||||
|
|
||||||
class OuterPortLoadModel:
|
|
||||||
@classmethod
|
|
||||||
def INPUT_TYPES(s):
|
|
||||||
return {
|
|
||||||
"required": {
|
|
||||||
"ckpt_name": (folder_paths.get_filename_list("checkpoints"), {"tooltip": "The name of the checkpoint (model) to load."}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
|
|
||||||
OUTPUT_TOOLTIPS = ("The model used for denoising latents.",
|
|
||||||
"The CLIP model used for encoding text prompts.",
|
|
||||||
"The VAE model used for encoding and decoding images to and from latent space.")
|
|
||||||
FUNCTION = "load_checkpoint"
|
|
||||||
|
|
||||||
CATEGORY = "loaders"
|
|
||||||
DESCRIPTION = "Loads a diffusion model checkpoint, diffusion models are used to denoise latents."
|
|
||||||
|
|
||||||
def load_checkpoint(self, ckpt_name):
|
|
||||||
ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name)
|
|
||||||
out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
|
|
||||||
return out[:3]
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {"OuterPortLoadModel": OuterPortLoadModel}
|
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {"OuterPortLoadModel": "Outer Port Load Model"}
|
|
||||||
Reference in New Issue
Block a user