Fix saver nodes return value bug

This commit is contained in:
Shellishack
2025-09-04 18:42:18 +08:00
parent 76eb3d72db
commit aaffe0ed5d
2 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "comfyui_remote_media_io"
version = "0.0.4"
version = "0.0.5"
description = "Load media (image/video/audio) from remote URL, and save results to remote storage."
authors = [
{name = "Ellis Shang", email = "you@gmail.com"}
+22 -13
View File
@@ -86,13 +86,12 @@ class SaveImageToRemote:
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("URL",)
RETURN_TYPES = ()
DESCRIPTION = cleandoc(__doc__)
FUNCTION = "save_image"
OUTPUT_NODE = True
# OUTPUT_TOOLTIPS = ("",) # Tooltips for the output node
OUTPUT_TOOLTIPS = ("Remote image URL",) # Tooltips for the output node
CATEGORY = "image"
@@ -140,10 +139,12 @@ class SaveImageToRemote:
print("Error uploading to Azure Blob Storage:", e)
raise e
return (
f"https://{os.getenv('AZURE_STORAGE_ACCOUNT_NAME')}.blob.core.windows.net/{os.getenv('AZURE_STORAGE_CONTAINER')}/{filename}",
result_url = (
f"https://{os.getenv('AZURE_STORAGE_ACCOUNT_NAME')}.blob.core.windows.net/{os.getenv('AZURE_STORAGE_CONTAINER')}/{filename}"
)
return {"ui": {"urls": (result_url,)}}
class SaveVideoToRemote:
"""
@@ -181,13 +182,13 @@ class SaveVideoToRemote:
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("URL",)
RETURN_TYPES = ()
DESCRIPTION = cleandoc(__doc__)
FUNCTION = "save_video"
CATEGORY = "image/video"
OUTPUT_NODE = True
OUTPUT_TOOLTIPS = ("Remote video URL",) # Tooltips for the output node
def save_video(self, video, filename):
format = filename.split(".")[-1].lower()
@@ -215,10 +216,14 @@ class SaveVideoToRemote:
file.close()
os.remove(output_path)
return (
f"https://{os.getenv('AZURE_STORAGE_ACCOUNT_NAME')}.blob.core.windows.net/{os.getenv('AZURE_STORAGE_CONTAINER')}/{filename}",
result_url = (
f"https://{os.getenv('AZURE_STORAGE_ACCOUNT_NAME')}.blob.core.windows.net/{os.getenv('AZURE_STORAGE_CONTAINER')}/{filename}"
)
return {
"ui": {"urls": (result_url,)},
}
class SaveAudioToRemote:
"""
@@ -276,13 +281,13 @@ class SaveAudioToRemote:
},
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("URL",)
RETURN_TYPES = ()
DESCRIPTION = cleandoc(__doc__)
FUNCTION = "save_audio"
CATEGORY = "audio"
OUTPUT_NODE = True
OUTPUT_TOOLTIPS = ("Remote audio URL",) # Tooltips for the output node
def save_audio(
self,
@@ -384,6 +389,10 @@ class SaveAudioToRemote:
file.close()
os.remove(output_path)
return (
f"https://{os.getenv('AZURE_STORAGE_ACCOUNT_NAME')}.blob.core.windows.net/{os.getenv('AZURE_STORAGE_CONTAINER')}/{filename}",
result_url = (
f"https://{os.getenv('AZURE_STORAGE_ACCOUNT_NAME')}.blob.core.windows.net/{os.getenv('AZURE_STORAGE_CONTAINER')}/{filename}"
)
return {
"ui": {"urls": (result_url,)},
}