diff --git a/__init__.py b/__init__.py index 9a51a30..24414d4 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ from .nodes.ai.FL_PixVerseAPI import FL_PixVerseAPI from .nodes.ai.FL_RunwayAct2 import FL_RunwayAct2 from .nodes.ai.FL_RunwayImageAPI import FL_RunwayImageAPI -# google-genai nodes — wrapped so a websockets version conflict doesn't kill the entire pack +# google-genai nodes — wrapped so SDK import errors don't kill the entire pack _GENAI_NODES_AVAILABLE = True try: from .nodes.ai.FL_GeminiImageEditor import FL_GeminiImageEditor @@ -28,10 +28,10 @@ try: from .nodes.ai.FL_GeminiTextAPI import FL_GeminiTextAPI from .nodes.ai.FL_VertexGemini25FlashImage import FL_VertexGemini25FlashImage from .nodes.ai.FL_VertexVeo3 import FL_Veo3VideoGen -except ImportError as e: +except Exception as e: _GENAI_NODES_AVAILABLE = False - logger.warning("Could not load Google Gemini/Vertex nodes: %s", e) - logger.info("Install google-genai with a compatible websockets version to enable these nodes.") + logger.warning("Skipping Google Gemini/Vertex nodes due to SDK/import incompatibility: %s", e) + logger.info("Install a compatible google-genai version to enable these nodes.") # API_TOOLS NODES from .nodes.api_tools.FL_API_Base64_ImageLoader import FL_API_Base64_ImageLoader diff --git a/nodes/image/FL_ImagePicker.py b/nodes/image/FL_ImagePicker.py index 93d5be1..86b5f03 100644 --- a/nodes/image/FL_ImagePicker.py +++ b/nodes/image/FL_ImagePicker.py @@ -27,8 +27,8 @@ class FL_ImagePicker: a modal UI for the user to select which images to keep from a batch. """ - RETURN_TYPES = ("IMAGE", "STRING") - RETURN_NAMES = ("selected_images", "selection_info") + RETURN_TYPES = ("IMAGE", "STRING", "STRING") + RETURN_NAMES = ("selected_images", "selection_info", "selected_indexes") FUNCTION = "select_images" CATEGORY = "🏵️Fill Nodes/Image" @@ -69,7 +69,7 @@ class FL_ImagePicker: batch_size = images.shape[0] if batch_size == 0: - return (images, "No images in batch") + return (images, "No images in batch", "") # Generate a session ID for this selection session_id = f"{unique_id}_{uuid.uuid4().hex[:8]}" @@ -157,16 +157,18 @@ class FL_ImagePicker: if selection is None or len(selection) == 0: # No selection - return all print(f"[FL_ImagePicker] No images selected. Returning all {batch_size} images.") - return (images, f"No selection: returned all {batch_size} images") + selected_indexes = ",".join(str(i) for i in range(batch_size)) + return (images, f"No selection: returned all {batch_size} images", selected_indexes) # Filter to selected indices selected_indices = sorted(selection) selected_images = images[selected_indices] info = f"Selected {len(selected_indices)} of {batch_size} images: indices {selected_indices}" + selected_indexes = ",".join(str(i) for i in selected_indices) print(f"[FL_ImagePicker] {info}") - return (selected_images, info) + return (selected_images, info, selected_indexes) # API endpoint to receive selection from frontend diff --git a/requirements.txt b/requirements.txt index ed3ae4f..63cc5b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ kornia opencv-python gdown open_clip_torch -google-genai +google-genai>=1.66.0,<2.0.0 google-cloud-storage fal-client runwayml