fix(plugin): external checkpoint fixes

This commit is contained in:
bennykok 2024-03-08 14:34:57 -08:00
parent 1bfbd91708
commit e73392ba8b
2 changed files with 7 additions and 4 deletions

View File

@ -16,7 +16,7 @@ class ComfyUIDeployExternalCheckpoint:
),
},
"optional": {
"default_checkpoint_name": (folder_paths.get_filename_list("checkpoints"), ),
"default_value": (folder_paths.get_filename_list("checkpoints"), ),
}
}
@ -27,12 +27,12 @@ class ComfyUIDeployExternalCheckpoint:
CATEGORY = "deploy"
def run(self, input_id, default_checkpoint_name=None):
def run(self, input_id, default_value=None):
import requests
import os
import uuid
if input_id and input_id.startswith('http'):
if default_value.startswith('http'):
unique_filename = str(uuid.uuid4()) + ".safetensors"
print(unique_filename)
print(folder_paths.folder_names_and_paths["checkpoints"][0][0])
@ -59,7 +59,7 @@ class ComfyUIDeployExternalCheckpoint:
out_file.write(chunk)
return (unique_filename,)
else:
return (default_checkpoints_name,)
return (default_value,)
NODE_CLASS_MAPPINGS = {

View File

@ -155,6 +155,9 @@ def send_prompt(sid: str, inputs: StreamingPrompt):
# Fix for external text default value
if (value["class_type"] == "ComfyUIDeployExternalText"):
value['inputs']["default_value"] = new_value
if (value["class_type"] == "ComfyUIDeployExternalCheckpoint"):
value['inputs']["default_value"] = new_value
print(workflow_api)