refactor: rename the name to input_id
This commit is contained in:
parent
eac8d709f9
commit
e6f5b16a54
@ -8,7 +8,7 @@ class ComfyUIDeployExternalImage:
|
|||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
return {
|
return {
|
||||||
"required": {
|
"required": {
|
||||||
"name": (
|
"input_id": (
|
||||||
"STRING",
|
"STRING",
|
||||||
{"multiline": False, "default": "input_image"},
|
{"multiline": False, "default": "input_image"},
|
||||||
),
|
),
|
||||||
@ -25,14 +25,14 @@ class ComfyUIDeployExternalImage:
|
|||||||
|
|
||||||
CATEGORY = "image"
|
CATEGORY = "image"
|
||||||
|
|
||||||
def run(self, name, default_image=None):
|
def run(self, input_id, default_image=None):
|
||||||
image = default_image
|
image = default_image
|
||||||
try:
|
try:
|
||||||
if name.startswith('http'):
|
if input_id.startswith('http'):
|
||||||
import requests
|
import requests
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
print("Fetching image from url: ", name)
|
print("Fetching image from url: ", input_id)
|
||||||
response = requests.get(name)
|
response = requests.get(input_id)
|
||||||
image = Image.open(BytesIO(response.content))
|
image = Image.open(BytesIO(response.content))
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid image url provided.")
|
raise ValueError("Invalid image url provided.")
|
||||||
|
@ -53,8 +53,8 @@ export async function createRun(
|
|||||||
if (inputs && workflow_api) {
|
if (inputs && workflow_api) {
|
||||||
for (const key in inputs) {
|
for (const key in inputs) {
|
||||||
Object.entries(workflow_api).forEach(([_, node]) => {
|
Object.entries(workflow_api).forEach(([_, node]) => {
|
||||||
if (node.inputs["name"] === key) {
|
if (node.inputs["input_id"] === key) {
|
||||||
node.inputs["name"] = inputs[key];
|
node.inputs["input_id"] = inputs[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user