Files
Superside ComfyUI Nodes df2c9c0beb Rename all 28 node classes with a Superside prefix
Root cause of nodes not appearing in ComfyUI: this package's node
classes originally reused the exact same class names as the internal
fal-flux-nodes package it was migrated from (e.g. NanoBananaProEditNode,
SeedreamV45EditNode). ComfyUI's NODE_CLASS_MAPPINGS is a flat global
dict - when both packages are installed, whichever loads first wins
and the other's registration for that key is silently dropped, which
is why none of the "Superside "-prefixed nodes were showing up.

Every class is now uniquely prefixed (e.g. SupersideNanoBananaProEditNode),
so this package can never collide with fal-flux-nodes, ComfyUI-fal-API,
or any other node pack regardless of install order. Updated __init__.py,
web/js/show_text.js's TEXT_DISPLAY_NODES list, and README.md to match.
2026-07-09 18:29:46 -04:00

72 lines
2.0 KiB
Python

import logging
from .base_node import (
SupersideFalNode,
ImageProcessingMixin,
APIClientMixin,
API_KEY_INPUT_SPEC,
)
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
class SupersideFlorence2CaptionNode(
SupersideFalNode, ImageProcessingMixin, APIClientMixin
):
"""
Florence-2 Large More Detailed Caption Node: Generate detailed captions
for images using Florence-2 Large model via fal.ai API.
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"image": ("IMAGE",),
"api_key": API_KEY_INPUT_SPEC,
},
}
RETURN_TYPES = ("STRING",)
FUNCTION = "caption"
DISPLAY_NAME = "Florence-2 Detailed Caption"
DESCRIPTION = "Generate detailed captions for images using Florence-2 Large model"
def prepare_arguments(self, client, image, **kwargs):
"""Prepare arguments for the API call."""
# Upload image and get URL
image_url = self.upload_image(client, image)
arguments = {
"image_url": image_url,
}
return arguments
def caption(self, image, api_key, **kwargs):
"""Main captioning function."""
try:
client = self.get_client(api_key)
arguments = self.prepare_arguments(client, image, **kwargs)
logger.info(f"Calling Florence-2 API with arguments: {arguments}")
result = self.call_api(
client, "fal-ai/florence-2-large/more-detailed-caption", arguments
)
logger.debug(f"API Response: {result}")
# Extract the caption from the results
if "results" not in result:
raise RuntimeError("No caption was generated by the API.")
caption = result["results"]
logger.info(f"Generated caption: {caption}")
# Return as a tuple (required by ComfyUI)
return (caption,)
except Exception as e:
logger.error(f"Captioning failed: {str(e)}")
raise