Fix node naming conflicts and improve status display

ISSUE #1: Node Naming Conflict
- Renamed to 'Load Image from URL (AI CustomURL)' to avoid conflict with ComfyUI's built-in 'Load Image'
- Same for Video Loader
- Now clearly distinguishable in node list

ISSUE #2: Show Text Node Not Displaying
- Fixed Show Text to properly display UI output
- Added pass-through output so it can chain
- Shows text in node and console
- Use this to display: video_id, status, text generation results, etc.

ISSUE #3: No Live Status Updates
- ComfyUI doesn't support streaming updates within single execution
- Console WILL show updates every 5 seconds as polling happens
- Added 'status' output to Generate Video node
- Possible values: 'completed', 'processing', 'timeout', 'failed', 'error'
- Connect 'status' to Show Text node to see final status in UI

ISSUE #4: Video Preview
- Preview shows text info with file path
- Video preview widget requires custom JavaScript (not implemented)
- Video IS downloaded and can be opened from temp path shown
- Use Save Video node for permanent storage

CLARIFICATION:
- For file uploads, use ComfyUI's built-in Load Image node (has upload button)
- Our nodes are specifically for URL loading (API-generated content)
This commit is contained in:
bowtiedbluefin
2025-11-09 01:56:41 -05:00
parent 738c829646
commit eacd1bbac4
2 changed files with 25 additions and 18 deletions
+11 -7
View File
@@ -306,6 +306,8 @@ class SaveVideoNode:
class ShowTextNode:
"""
Display text in ComfyUI interface
Connect any STRING output to this node to display it
"""
@classmethod
@@ -320,14 +322,16 @@ class ShowTextNode:
},
}
RETURN_TYPES = ()
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("text",)
FUNCTION = "show_text"
CATEGORY = "ai_customurl"
OUTPUT_NODE = True
def show_text(self, text):
"""Display text"""
return {"ui": {"text": [text]}}
"""Display text in UI and pass it through"""
print(f"[SHOW TEXT] {text}")
return {"ui": {"text": [text]}, "result": (text,)}
NODE_CLASS_MAPPINGS = {
@@ -342,11 +346,11 @@ NODE_CLASS_MAPPINGS = {
}
NODE_DISPLAY_NAME_MAPPINGS = {
"ImageLoader_AICustomURL": "Load Image (AI CustomURL)",
"VideoLoader_AICustomURL": "Load Video (AI CustomURL)",
"ImageLoader_AICustomURL": "Load Image from URL (AI CustomURL)",
"VideoLoader_AICustomURL": "Load Video from URL (AI CustomURL)",
"SaveVideo_AICustomURL": "Save Video from URL",
"ShowText_AICustomURL": "Show Text (AI CustomURL)",
# Backwards compatibility
"ImageURLLoader_AICustomURL": "Load Image from URL",
"VideoURLLoader_AICustomURL": "Load Video from URL",
"ImageURLLoader_AICustomURL": "Load Image from URL (AI CustomURL)",
"VideoURLLoader_AICustomURL": "Load Video from URL (AI CustomURL)",
}
+14 -11
View File
@@ -72,10 +72,11 @@ class VideoGenerationNode:
},
}
RETURN_TYPES = ("STRING", "STRING", "STRING", "STRING")
RETURN_NAMES = ("video_url", "video_id", "api_key", "response_json")
RETURN_TYPES = ("STRING", "STRING", "STRING", "STRING", "STRING")
RETURN_NAMES = ("video_url", "video_id", "api_key", "status", "response_json")
FUNCTION = "generate_video"
CATEGORY = "ai_customurl"
OUTPUT_NODE = True
def generate_video(
self,
@@ -245,7 +246,7 @@ class VideoGenerationNode:
elif status == "failed":
error_msg = poll_response.get("error", "Unknown error")
print(f"[ERROR] Video generation failed: {error_msg}")
return ("", video_id, json.dumps(poll_response, indent=2))
return ("", video_id, api_key, "failed", json.dumps(poll_response, indent=2))
except Exception as poll_error:
print(f"[WARNING] Poll error: {poll_error}")
# Continue polling despite error
@@ -254,7 +255,7 @@ class VideoGenerationNode:
if status != "completed":
print(f"[WARNING] Max wait time ({max_wait_time}s) reached. Status: {status}")
print(f"[INFO] Use 'Retrieve Video Status' node with ID: {video_id}")
return ("", video_id, response_json)
return ("", video_id, api_key, f"timeout (status: {status})", response_json)
# Extract URL if completed
if status == "completed":
@@ -287,13 +288,18 @@ class VideoGenerationNode:
if not video_url and not video_id:
print(f"[WARNING] No video URL or ID found in response")
status = "error"
elif not video_url:
status = "processing"
else:
status = "completed"
return (video_url, video_id, api_key, response_json)
return (video_url, video_id, api_key, status, response_json)
except Exception as e:
error_msg = f"Video generation failed: {str(e)}"
print(error_msg)
return (error_msg, "", "", str(e))
return (error_msg, "", "", "error", str(e))
class VideoAdvancedParamsNode:
@@ -567,13 +573,10 @@ class VideoPreviewNode:
# Return simple text message - video preview in ComfyUI requires custom JS widget
# For now, just show success message and file path
preview_text = f"✅ Video downloaded! ({file_size_mb:.2f} MB)\n📁 {video_path}\n💡 Tip: Use 'Save Video from URL' to save permanently"
return {
"ui": {
"text": [
f"✅ Video preview ready! ({file_size_mb:.2f} MB)",
f"📁 Temp location: {video_path}",
f"💡 Use 'Save Video from URL' node to save permanently"
]
"text": [preview_text]
}
}