fix(plugin): external checkpoint fixes
This commit is contained in:
parent
1bfbd91708
commit
e73392ba8b
@ -16,7 +16,7 @@ class ComfyUIDeployExternalCheckpoint:
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
"optional": {
|
"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"
|
CATEGORY = "deploy"
|
||||||
|
|
||||||
def run(self, input_id, default_checkpoint_name=None):
|
def run(self, input_id, default_value=None):
|
||||||
import requests
|
import requests
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
if input_id and input_id.startswith('http'):
|
if default_value.startswith('http'):
|
||||||
unique_filename = str(uuid.uuid4()) + ".safetensors"
|
unique_filename = str(uuid.uuid4()) + ".safetensors"
|
||||||
print(unique_filename)
|
print(unique_filename)
|
||||||
print(folder_paths.folder_names_and_paths["checkpoints"][0][0])
|
print(folder_paths.folder_names_and_paths["checkpoints"][0][0])
|
||||||
@ -59,7 +59,7 @@ class ComfyUIDeployExternalCheckpoint:
|
|||||||
out_file.write(chunk)
|
out_file.write(chunk)
|
||||||
return (unique_filename,)
|
return (unique_filename,)
|
||||||
else:
|
else:
|
||||||
return (default_checkpoints_name,)
|
return (default_value,)
|
||||||
|
|
||||||
|
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
|
@ -155,6 +155,9 @@ def send_prompt(sid: str, inputs: StreamingPrompt):
|
|||||||
# Fix for external text default value
|
# Fix for external text default value
|
||||||
if (value["class_type"] == "ComfyUIDeployExternalText"):
|
if (value["class_type"] == "ComfyUIDeployExternalText"):
|
||||||
value['inputs']["default_value"] = new_value
|
value['inputs']["default_value"] = new_value
|
||||||
|
|
||||||
|
if (value["class_type"] == "ComfyUIDeployExternalCheckpoint"):
|
||||||
|
value['inputs']["default_value"] = new_value
|
||||||
|
|
||||||
|
|
||||||
print(workflow_api)
|
print(workflow_api)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user