video and lora node fix

This commit is contained in:
nick 2024-08-28 13:08:15 -07:00
parent 649b61c580
commit a99d2568e0
2 changed files with 14 additions and 6 deletions

View File

@ -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,7 +51,15 @@ class ComfyUIDeployExternalLora:
CATEGORY = "deploy" CATEGORY = "deploy"
def run(self, input_id, default_lora_name=None, lora_save_name=None, display_name=None, description=None, lora_url=None): def run(
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
@ -71,9 +79,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 - " + input_id + " to " + destination_path) print("Downloading external lora - " + lora_url + " to " + destination_path)
response = requests.get( response = requests.get(
input_id, lora_url,
headers={"User-Agent": "Mozilla/5.0"}, headers={"User-Agent": "Mozilla/5.0"},
allow_redirects=True, allow_redirects=True,
) )

View File

@ -834,7 +834,7 @@ class ComfyUIDeployExternalVideo:
): ):
out_file.write(chunk) out_file.write(chunk)
else: else:
video = kwargs.get("default_video", "") video = kwargs.get("default_video", None)
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('"'))