diff --git a/__init__.py b/__init__.py index 0a6e81d..2950882 100644 --- a/__init__.py +++ b/__init__.py @@ -15,7 +15,11 @@ from .nodes import ( TailoredPortraitNode, ReimagineNode, GenerateImageNodeV2, + GenerateImageLiteNodeV2, RefineImageNodeV2, + RefineImageLiteNodeV2, + GenerateStructuredPromptNodeV2, + GenerateStructuredPromptLiteNodeV2, ShotByTextAutomaticNode, ShotByImageManualPaddingNode, ShotByImageAutomaticAspectRatioNode, @@ -58,7 +62,11 @@ NODE_CLASS_MAPPINGS = { "ReimagineNode": ReimagineNode, "AttributionByImageNode": AttributionByImageNode, "GenerateImageNodeV2": GenerateImageNodeV2, + "GenerateImageLiteNodeV2": GenerateImageLiteNodeV2, "RefineImageNodeV2": RefineImageNodeV2, + "RefineImageLiteNodeV2": RefineImageLiteNodeV2, + "GenerateStructuredPromptNodeV2": GenerateStructuredPromptNodeV2, + "GenerateStructuredPromptLiteNodeV2": GenerateStructuredPromptLiteNodeV2, } # Map the node display name to the one shown in the ComfyUI node interface NODE_DISPLAY_NAME_MAPPINGS = { @@ -89,5 +97,11 @@ NODE_DISPLAY_NAME_MAPPINGS = { "ReimagineNode": "Bria Reimagine", "AttributionByImageNode": "Attribution By Image Node", "GenerateImageNodeV2": "Generate Image", + "GenerateImageLiteNodeV2": "Generate Image - Lite", "RefineImageNodeV2": "Refine and Regenerate Image", + "RefineImageLiteNodeV2": "Refine Image - Lite", + "GenerateStructuredPromptNodeV2": "Generate Structured Prompt", + "GenerateStructuredPromptLiteNodeV2": "Generate Structured Prompt - Lite", } + + diff --git a/nodes/__init__.py b/nodes/__init__.py index 5350502..0ef7848 100644 --- a/nodes/__init__.py +++ b/nodes/__init__.py @@ -11,8 +11,12 @@ from .text_2_image_base_node import Text2ImageBaseNode from .text_2_image_fast_node import Text2ImageFastNode from .text_2_image_hd_node import Text2ImageHDNode from .reimagine_node import ReimagineNode -from .generate_image_node_v2 import GenerateImageNodeV2 -from .refine_image_node_v2 import RefineImageNodeV2 +from .generate_image_node_v2 import GenerateImageNodeV2, GenerateImageLiteNodeV2 +from .refine_image_node_v2 import RefineImageNodeV2, RefineImageLiteNodeV2 +from .generate_structured_prompt_node_v2 import ( + GenerateStructuredPromptNodeV2, + GenerateStructuredPromptLiteNodeV2, +) from .shot_by_text_node import ShotByTextOriginalNode from .shot_by_text_automatic_aspect_ratio_node import ShotByTextAutomaticAspectRatioNode from .shot_by_text_automatic_node import ShotByTextAutomaticNode diff --git a/nodes/generate_image_node_v2.py b/nodes/generate_image_node_v2.py index 0606e05..ca75c65 100644 --- a/nodes/generate_image_node_v2.py +++ b/nodes/generate_image_node_v2.py @@ -14,26 +14,44 @@ class _BaseGenerateImageNodeV2: """Base class for image generation nodes (standard & pro).""" api_url = None # Each subclass must define its API endpoint + supports_negative_prompt = True # Can be overridden by subclasses + # STEP SETTINGS (defaults for standard API) + default_steps = 50 + min_steps = 35 + max_steps = 50 @classmethod def INPUT_TYPES(cls): + optional_inputs = { + "model_version": (["FIBO"], {"default": "FIBO"}), + "structured_prompt": ("STRING",), + "images": ("IMAGE",), + "aspect_ratio": ( + ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"], + {"default": "1:1"}, + ), + "steps_num": ( + "INT", + { + "default": cls.default_steps, + "min": cls.min_steps, + "max": cls.max_steps, + }, + ), + "guidance_scale": ("INT", {"default": 5, "min": 3, "max": 5}), + "seed": ("INT", {"default": 123456}), + } + + # Add negative_prompt only if supported + if cls.supports_negative_prompt: + optional_inputs["negative_prompt"] = ("STRING", {"default": ""}) + return { "required": { "api_token": ("STRING", {"default": "BRIA_API_TOKEN"}), "prompt": ("STRING",), }, - "optional": { - "model_version": (["FIBO"], {"default": "FIBO"}), - "negative_prompt": ("STRING", {"default": ""}), - "images": ("IMAGE",), - "aspect_ratio": ( - ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"], - {"default": "1:1"}, - ), - "steps_num": ("INT", {"default": 50, "min": 20, "max": 50}), - "guidance_scale": ("INT", {"default": 5, "min": 3, "max": 5}), - "seed": ("INT", {"default": 123456}), - }, + "optional": optional_inputs, } RETURN_TYPES = ("IMAGE", "STRING", "INT") @@ -49,29 +67,33 @@ class _BaseGenerateImageNodeV2: self, prompt, model_version, - negative_prompt, + structured_prompt, aspect_ratio, steps_num, guidance_scale, seed, + negative_prompt=None, images=None, ): payload = { "prompt": prompt, "model_version": model_version, - "negative_prompt": negative_prompt, + "structured_prompt":structured_prompt, "aspect_ratio": aspect_ratio, "steps_num": steps_num, "guidance_scale": guidance_scale, "seed": seed, } + # Add negative_prompt only if supported and provided + if self.supports_negative_prompt and negative_prompt is not None: + payload["negative_prompt"] = negative_prompt + if images is not None: if isinstance(images, torch.Tensor): preprocess_images = preprocess_image(images) payload["images"] = [image_to_base64(preprocess_images)] - return payload def execute( @@ -79,22 +101,24 @@ class _BaseGenerateImageNodeV2: api_token, prompt, model_version, - negative_prompt, + structured_prompt, aspect_ratio, steps_num, guidance_scale, seed, + negative_prompt=None, images=None, ): self._validate_token(api_token) payload = self._build_payload( prompt, model_version, - negative_prompt, + structured_prompt, aspect_ratio, steps_num, guidance_scale, seed, + negative_prompt, images, ) api_token = deserialize_and_get_comfy_key(api_token) @@ -141,3 +165,12 @@ class GenerateImageNodeV2(_BaseGenerateImageNodeV2): """Standard Image Generation Node""" def __init__(self): self.api_url = "https://engine.prod.bria-api.com/v2/image/generate" + +class GenerateImageLiteNodeV2(_BaseGenerateImageNodeV2): + """Lite Image Generation Node""" + supports_negative_prompt = False + default_steps = 8 + min_steps = 8 + max_steps = 30 + def __init__(self): + self.api_url = "https://engine.prod.bria-api.com/v2/image/generate/lite" \ No newline at end of file diff --git a/nodes/generate_structured_prompt_node_v2.py b/nodes/generate_structured_prompt_node_v2.py new file mode 100644 index 0000000..df7516d --- /dev/null +++ b/nodes/generate_structured_prompt_node_v2.py @@ -0,0 +1,118 @@ +import requests +from .common import ( + deserialize_and_get_comfy_key, + image_to_base64, + poll_status_until_completed, + preprocess_image, +) +import torch + + +class _BaseGenerateStructuredPromptNodeV2: + """Base class for structured prompt generation nodes (standard & lite).""" + + api_url = None # Each subclass must define its API endpoint + + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "api_token": ("STRING", {"default": "BRIA_API_TOKEN"}), + "prompt": ("STRING",), + }, + "optional": { + "structured_prompt": ("STRING",), + "images": ("IMAGE",), + "seed": ("INT", {"default": 123456}), + }, + } + + RETURN_TYPES = ("STRING", "INT") + RETURN_NAMES = ("structured_prompt", "seed") + CATEGORY = "API Nodes" + FUNCTION = "execute" + + def _validate_token(self, api_token: str): + if api_token.strip() == "" or api_token.strip() == "BRIA_API_TOKEN": + raise Exception("Please insert a valid API token.") + + def _build_payload( + self, + prompt, + seed, + structured_prompt, + images=None + ): + payload = { + "prompt": prompt, + "seed": seed, + "structured_prompt":structured_prompt + } + if images is not None: + if isinstance(images, torch.Tensor): + preprocess_images = preprocess_image(images) + payload["images"] = [image_to_base64(preprocess_images)] + return payload + + def execute( + self, + api_token, + prompt, + seed, + structured_prompt, + images=None, + ): + self._validate_token(api_token) + payload = self._build_payload( + prompt, + seed, + structured_prompt, + images + ) + api_token = deserialize_and_get_comfy_key(api_token) + + headers = {"Content-Type": "application/json", "api_token": api_token} + + try: + response = requests.post(self.api_url, json=payload, headers=headers) + + if response.status_code in (200, 202): + print( + f"Initial request successful to {self.api_url}, polling for completion..." + ) + response_dict = response.json() + status_url = response_dict.get("status_url") + request_id = response_dict.get("request_id") + + if not status_url: + raise Exception("No status_url returned from API") + + print(f"Request ID: {request_id}, Status URL: {status_url}") + + final_response = poll_status_until_completed(status_url, api_token) + + result = final_response.get("result", {}) + structured_prompt = result.get("structured_prompt", "") + used_seed = result.get("seed", seed) + + return (structured_prompt, used_seed) + + raise Exception( + f"Error: API request failed with status code {response.status_code} {response.text}" + ) + + except Exception as e: + raise Exception(f"{e}") + + +class GenerateStructuredPromptNodeV2(_BaseGenerateStructuredPromptNodeV2): + """Standard Structured Prompt Generation Node""" + def __init__(self): + self.api_url = "https://engine.prod.bria-api.com/v2/structured_prompt/generate" + + +class GenerateStructuredPromptLiteNodeV2(_BaseGenerateStructuredPromptNodeV2): + """Lite Structured Prompt Generation Node""" + def __init__(self): + self.api_url = "https://engine.prod.bria-api.com/v2/structured_prompt/generate/lite" + diff --git a/nodes/refine_image_node_v2.py b/nodes/refine_image_node_v2.py index 3128c1b..551ad62 100644 --- a/nodes/refine_image_node_v2.py +++ b/nodes/refine_image_node_v2.py @@ -7,26 +7,42 @@ class _BaseRefineImageNodeV2: api_url = None # Must be overridden by subclasses generate_api_url = None - + supports_negative_prompt = True # Can be overridden by subclasses + # STEP SETTINGS (defaults for standard API) + default_steps = 50 + min_steps = 35 + max_steps = 50 @classmethod def INPUT_TYPES(cls): + optional_inputs = { + "model_version": (["FIBO"], {"default": "FIBO"}), + "aspect_ratio": ( + ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"], + {"default": "1:1"}, + ), + "steps_num": ( + "INT", + { + "default": cls.default_steps, + "min": cls.min_steps, + "max": cls.max_steps, + }, + ), + "guidance_scale": ("INT", {"default": 5, "min": 3, "max": 5}), + "seed": ("INT", {"default": 123456}), + } + + # Add negative_prompt only if supported + if cls.supports_negative_prompt: + optional_inputs["negative_prompt"] = ("STRING", {"default": ""}) + return { "required": { "api_token": ("STRING", {"default": "BRIA_API_TOKEN"}), "prompt": ("STRING",), "structured_prompt": ("STRING",), }, - "optional": { - "model_version": (["FIBO"], {"default": "FIBO"}), - "negative_prompt": ("STRING", {"default": ""}), - "aspect_ratio": ( - ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"], - {"default": "1:1"}, - ), - "steps_num": ("INT", {"default": 50, "min": 20, "max": 50}), - "guidance_scale": ("INT", {"default": 5, "min": 3, "max": 5}), - "seed": ("INT", {"default": 123456}), - }, + "optional": optional_inputs, } RETURN_TYPES = ("IMAGE", "STRING", "INT") @@ -43,22 +59,26 @@ class _BaseRefineImageNodeV2: prompt, structured_prompt, model_version, - negative_prompt, aspect_ratio, steps_num, guidance_scale, seed, + negative_prompt=None, ): - return { + payload = { "prompt": prompt, "model_version": model_version, - "negative_prompt": negative_prompt, "aspect_ratio": aspect_ratio, "steps_num": steps_num, "guidance_scale": guidance_scale, "seed": seed, "structured_prompt": structured_prompt, } + + if self.supports_negative_prompt and negative_prompt is not None: + payload["negative_prompt"] = negative_prompt + + return payload def execute( self, @@ -66,22 +86,22 @@ class _BaseRefineImageNodeV2: prompt, structured_prompt, model_version, - negative_prompt, aspect_ratio, steps_num, guidance_scale, seed, + negative_prompt=None, ): self._validate_token(api_token) payload = self._build_payload( prompt, structured_prompt, model_version, - negative_prompt, aspect_ratio, steps_num, guidance_scale, seed, + negative_prompt, ) api_token = deserialize_and_get_comfy_key(api_token) headers = {"Content-Type": "application/json", "api_token": api_token} @@ -111,12 +131,16 @@ class _BaseRefineImageNodeV2: "prompt": prompt, "structured_prompt":structured_prompt, "model_version": model_version, - "negative_prompt": negative_prompt, "aspect_ratio": aspect_ratio, "steps_num": steps_num, "guidance_scale": guidance_scale, "seed": used_seed, } + + # Add negative_prompt only if supported and provided + if self.supports_negative_prompt and negative_prompt is not None: + payloadForImageGenetrate["negative_prompt"] = negative_prompt + headers = {"Content-Type": "application/json", "api_token": api_token} response = requests.post(self.generate_api_url, json=payloadForImageGenetrate, headers=headers) @@ -158,4 +182,17 @@ class RefineImageNodeV2(_BaseRefineImageNodeV2): """Standard Refine Image Node""" def __init__(self): self.api_url = "https://engine.prod.bria-api.com/v2/structured_prompt/generate" - self.generate_api_url = "https://engine.prod.bria-api.com/v2/image/generate" \ No newline at end of file + self.generate_api_url = "https://engine.prod.bria-api.com/v2/image/generate" + + +class RefineImageLiteNodeV2(_BaseRefineImageNodeV2): + """Lite Refine Image Node""" + supports_negative_prompt = False + supports_negative_prompt = False + default_steps = 8 + min_steps = 8 + max_steps = 30 + + def __init__(self): + self.api_url = "https://engine.prod.bria-api.com/v2/structured_prompt/generate/lite" + self.generate_api_url = "https://engine.prod.bria-api.com/v2/image/generate/lite" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6a3d452..51d159c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-bria-api" description = "Custom nodes for ComfyUI using BRIA's API." -version = "2.1.8" +version = "2.1.9" license = {file = "LICENSE"} [project.urls] diff --git a/workflows/generate_image_fibo-lite_workflow.json b/workflows/generate_image_fibo-lite_workflow.json new file mode 100644 index 0000000..b83d037 --- /dev/null +++ b/workflows/generate_image_fibo-lite_workflow.json @@ -0,0 +1,661 @@ +{ + "id": "1c31a92d-1e48-46b0-b4ad-60d537260922", + "revision": 0, + "last_node_id": 27, + "last_link_id": 46, + "nodes": [ + { + "id": 5, + "type": "PreviewImage", + "pos": [ + 1235.1895751953125, + 10.958272933959961 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 43 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 6, + "type": "PreviewImage", + "pos": [ + 774.4347534179688, + -58.6872444152832 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 29 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 1, + "type": "Note", + "pos": [ + -175.84976196289062, + 102.76270294189453 + ], + "size": [ + 210, + 88 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "If you would like to start with prompt" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 2, + "type": "Note", + "pos": [ + -225.1866455078125, + 624.7235107421875 + ], + "size": [ + 210, + 88 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "If you would like to start with reference image + prompt" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 15, + "type": "PreviewImage", + "pos": [ + 719.5359497070312, + 443.11285400390625 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 36 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 17, + "type": "PreviewImage", + "pos": [ + 1132.783935546875, + 517.3931884765625 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 44 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 20, + "type": "GenerateStructuredPromptLiteNodeV2", + "pos": [ + 68.9760971069336, + 82.11421966552734 + ], + "size": [ + 310.7749938964844, + 174 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "images", + "shape": 7, + "type": "IMAGE", + "link": null + } + ], + "outputs": [ + { + "name": "structured_prompt", + "type": "STRING", + "links": [ + 27 + ] + }, + { + "name": "seed", + "type": "INT", + "links": [ + 28 + ] + } + ], + "properties": { + "Node name for S&R": "GenerateStructuredPromptLiteNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + 123456, + "randomize" + ] + }, + { + "id": 24, + "type": "GenerateImageLiteNodeV2", + "pos": [ + 460.6510314941406, + 44.938873291015625 + ], + "size": [ + 270, + 290 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "structured_prompt", + "shape": 7, + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 27 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 28 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 29 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": [ + 41 + ] + }, + { + "name": "seed", + "type": "INT", + "links": [ + 42 + ] + } + ], + "properties": { + "Node name for S&R": "GenerateImageLiteNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "FIBO", + "", + "1:1", + 8, + 5, + 123456, + "randomize" + ] + }, + { + "id": 26, + "type": "RefineImageLiteNodeV2", + "pos": [ + 834.9641723632812, + 46.47432327270508 + ], + "size": [ + 270, + 290 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "structured_prompt", + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 41 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 42 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 43 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": null + }, + { + "name": "seed", + "type": "INT", + "links": null + } + ], + "properties": { + "Node name for S&R": "RefineImageLiteNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + "FIBO", + "1:1", + 8, + 5, + 123456, + "randomize" + ] + }, + { + "id": 25, + "type": "GenerateImageLiteNodeV2", + "pos": [ + 404.58843994140625, + 532.5309448242188 + ], + "size": [ + 270, + 290 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "structured_prompt", + "shape": 7, + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 34 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 35 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 36 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": [ + 45 + ] + }, + { + "name": "seed", + "type": "INT", + "links": [ + 46 + ] + } + ], + "properties": { + "Node name for S&R": "GenerateImageLiteNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "FIBO", + "", + "1:1", + 8, + 5, + 123456, + "randomize" + ] + }, + { + "id": 27, + "type": "RefineImageLiteNodeV2", + "pos": [ + 820.26611328125, + 558.9785766601562 + ], + "size": [ + 270, + 290 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "structured_prompt", + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 45 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 46 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 44 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": null + }, + { + "name": "seed", + "type": "INT", + "links": null + } + ], + "properties": { + "Node name for S&R": "RefineImageLiteNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + "FIBO", + "1:1", + 8, + 5, + 123456, + "randomize" + ] + }, + { + "id": 21, + "type": "GenerateStructuredPromptLiteNodeV2", + "pos": [ + 3.162916421890259, + 587.301025390625 + ], + "size": [ + 310.7749938964844, + 174 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "images", + "shape": 7, + "type": "IMAGE", + "link": null + } + ], + "outputs": [ + { + "name": "structured_prompt", + "type": "STRING", + "links": [ + 34 + ] + }, + { + "name": "seed", + "type": "INT", + "links": [ + 35 + ] + } + ], + "properties": { + "Node name for S&R": "GenerateStructuredPromptLiteNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + 123456, + "randomize" + ] + } + ], + "links": [ + [ + 27, + 20, + 0, + 24, + 1, + "STRING" + ], + [ + 28, + 20, + 1, + 24, + 2, + "INT" + ], + [ + 29, + 24, + 0, + 6, + 0, + "IMAGE" + ], + [ + 34, + 21, + 0, + 25, + 1, + "STRING" + ], + [ + 35, + 21, + 1, + 25, + 2, + "INT" + ], + [ + 36, + 25, + 0, + 15, + 0, + "IMAGE" + ], + [ + 41, + 24, + 1, + 26, + 0, + "STRING" + ], + [ + 42, + 24, + 2, + 26, + 1, + "INT" + ], + [ + 43, + 26, + 0, + 5, + 0, + "IMAGE" + ], + [ + 44, + 27, + 0, + 17, + 0, + "IMAGE" + ], + [ + 45, + 25, + 1, + 27, + 0, + "STRING" + ], + [ + 46, + 25, + 2, + 27, + 1, + "INT" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.6276708501927047, + "offset": [ + 650.5506889681789, + 132.55696596915172 + ] + }, + "frontendVersion": "1.25.11" + }, + "version": 0.4 +} \ No newline at end of file diff --git a/workflows/FIBO_Workflow.json b/workflows/generate_image_fibo_workflow.json similarity index 63% rename from workflows/FIBO_Workflow.json rename to workflows/generate_image_fibo_workflow.json index 8240df1..0189129 100644 --- a/workflows/FIBO_Workflow.json +++ b/workflows/generate_image_fibo_workflow.json @@ -1,22 +1,51 @@ { "id": "3875cd62-7a0e-4c8c-8951-22ec8a63dd8d", "revision": 0, - "last_node_id": 14, - "last_link_id": 8, + "last_node_id": 18, + "last_link_id": 19, "nodes": [ { - "id": 3, + "id": 4, "type": "PreviewImage", "pos": [ - 632.3427124023438, - 32.13115310668945 + 1284.572509765625, + 229.44073486328125 ], "size": [ 140, 26 ], "flags": {}, - "order": 4, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 16 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage", + "cnr_id": "comfy-core", + "ver": "0.3.62" + }, + "widgets_values": [] + }, + { + "id": 3, + "type": "PreviewImage", + "pos": [ + 809.5054321289062, + 38.50392150878906 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 6, "mode": 0, "inputs": [ { @@ -27,102 +56,119 @@ ], "outputs": [], "properties": { + "Node name for S&R": "PreviewImage", "cnr_id": "comfy-core", - "ver": "0.3.62", - "Node name for S&R": "PreviewImage" - } + "ver": "0.3.62" + }, + "widgets_values": [] }, { - "id": 2, - "type": "RefineImageNodeV2", + "id": 5, + "type": "Note", "pos": [ - 704.8090209960938, - 218.65850830078125 + -143.02835083007812, + 277.0796203613281 ], "size": [ - 287.4712829589844, - 314 + 210, + 88 ], "flags": {}, - "order": 5, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [], + "properties": {}, + "widgets_values": [ + "If you would like to start with prompt" + ], + "color": "#c09430", + "bgcolor": "rgba(24,24,27,.9)" + }, + { + "id": 16, + "type": "GenerateStructuredPromptNodeV2", + "pos": [ + 110.83424377441406, + 260.3714294433594 + ], + "size": [ + 275.7613220214844, + 174 + ], + "flags": {}, + "order": 1, "mode": 0, "inputs": [ { - "name": "structured_prompt", - "type": "STRING", - "widget": { - "name": "structured_prompt" - }, - "link": 3 - }, - { - "name": "seed", + "name": "images", "shape": 7, - "type": "INT", - "widget": { - "name": "seed" - }, - "link": 2 + "type": "IMAGE", + "link": null } ], "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 4 - ] - }, { "name": "structured_prompt", "type": "STRING", - "links": null + "links": [ + 9 + ] }, { "name": "seed", "type": "INT", - "links": null + "links": [ + 10 + ] } ], "properties": { - "cnr_id": "comfyui-bria-api", - "ver": "2.1.4", - "Node name for S&R": "RefineImageNodeV2", - "ue_properties": { - "widget_ue_connectable": { - "api_token": true, - "prompt": true, - "structured_prompt": true, - "model_version": true, - "negative_prompt": true, - "aspect_ratio": true, - "steps_num": true, - "guidance_scale": true, - "seed": true - }, - "version": "7.1", - "input_ue_unconnectable": {} - } + "Node name for S&R": "GenerateStructuredPromptNodeV2" }, "widgets_values": [ "BRIA_API_TOKEN", "", "", - "FIBO", - "", - "1:1", - 50, - 5, 123456, "randomize" ] }, { - "id": 4, + "id": 10, "type": "PreviewImage", "pos": [ - 1153.29345703125, - 270.2264404296875 + 1261.5439453125, + 996.5408935546875 + ], + "size": [ + 140, + 26 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 19 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage", + "cnr_id": "comfy-core", + "ver": "0.3.62" + }, + "widgets_values": [] + }, + { + "id": 14, + "type": "PreviewImage", + "pos": [ + 751.5670166015625, + 845.8276977539062 ], "size": [ 140, @@ -135,219 +181,23 @@ { "name": "images", "type": "IMAGE", - "link": 4 + "link": 8 } ], "outputs": [], "properties": { + "Node name for S&R": "PreviewImage", "cnr_id": "comfy-core", - "ver": "0.3.62", - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 1, - "type": "GenerateImageNodeV2", - "pos": [ - 272.6366882324219, - 227.9468231201172 - ], - "size": [ - 270, - 290 - ], - "flags": {}, - "order": 0, - "mode": 0, - "inputs": [ - { - "name": "images", - "shape": 7, - "type": "IMAGE", - "link": null - } - ], - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 1 - ] - }, - { - "name": "structured_prompt", - "type": "STRING", - "links": [ - 3 - ] - }, - { - "name": "seed", - "type": "INT", - "links": [ - 2 - ] - } - ], - "properties": { - "cnr_id": "comfyui-bria-api", - "ver": "2.1.4", - "Node name for S&R": "GenerateImageNodeV2", - "ue_properties": { - "widget_ue_connectable": { - "api_token": true, - "prompt": true, - "model_version": true, - "negative_prompt": true, - "aspect_ratio": true, - "steps_num": true, - "guidance_scale": true, - "seed": true - }, - "version": "7.1", - "input_ue_unconnectable": {} - } + "ver": "0.3.62" }, - "widgets_values": [ - "BRIA_API_TOKEN", - "", - "FIBO", - "", - "1:1", - 50, - 5, - 123456, - "randomize" - ] - }, - { - "id": 5, - "type": "Note", - "pos": [ - -43.613197326660156, - 324.2381896972656 - ], - "size": [ - 210, - 88 - ], - "flags": {}, - "order": 1, - "mode": 0, - "inputs": [], - "outputs": [], - "properties": {}, - "widgets_values": [ - "If you would like to start with prompt" - ], - "color": "#c09430", - "bgcolor": "rgba(24,24,27,.9)" - }, - { - "id": 10, - "type": "PreviewImage", - "pos": [ - 1182.5216064453125, - 1006.7373657226562 - ], - "size": [ - 140, - 26 - ], - "flags": {}, - "order": 9, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 7 - } - ], - "outputs": [], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.62", - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 9, - "type": "RefineImageNodeV2", - "pos": [ - 703.2684326171875, - 1034.9910888671875 - ], - "size": [ - 287.4712829589844, - 314 - ], - "flags": {}, - "order": 7, - "mode": 0, - "inputs": [ - { - "name": "structured_prompt", - "type": "STRING", - "widget": { - "name": "structured_prompt" - }, - "link": 5 - }, - { - "name": "seed", - "shape": 7, - "type": "INT", - "widget": { - "name": "seed" - }, - "link": 6 - } - ], - "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 7 - ] - }, - { - "name": "structured_prompt", - "type": "STRING", - "links": null - }, - { - "name": "seed", - "type": "INT", - "links": null - } - ], - "properties": { - "cnr_id": "comfyui-bria-api", - "ver": "2.1.5", - "Node name for S&R": "RefineImageNodeV2" - }, - "widgets_values": [ - "BRIA_API_TOKEN", - "", - "", - "FIBO", - "", - "1:1", - 50, - 5, - 123456, - "randomize" - ] + "widgets_values": [] }, { "id": 6, "type": "Note", "pos": [ - -47.50065612792969, - 1042.9178466796875 + -135.44485473632812, + 1056.937744140625 ], "size": [ 210, @@ -366,43 +216,15 @@ "bgcolor": "rgba(24,24,27,.9)" }, { - "id": 14, - "type": "PreviewImage", + "id": 15, + "type": "GenerateStructuredPromptNodeV2", "pos": [ - 593.5224609375, - 844.5531616210938 + 117.20681762695312, + 1049.3199462890625 ], "size": [ - 140, - 26 - ], - "flags": {}, - "order": 6, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 8 - } - ], - "outputs": [], - "properties": { - "cnr_id": "comfy-core", - "ver": "0.3.62", - "Node name for S&R": "PreviewImage" - } - }, - { - "id": 7, - "type": "GenerateImageNodeV2", - "pos": [ - 262.3690490722656, - 1041.67431640625 - ], - "size": [ - 270, - 290 + 275.7613220214844, + 174 ], "flags": {}, "order": 3, @@ -416,32 +238,113 @@ } ], "outputs": [ - { - "name": "image", - "type": "IMAGE", - "links": [ - 8 - ] - }, { "name": "structured_prompt", "type": "STRING", "links": [ - 5 + 11 ] }, { "name": "seed", "type": "INT", "links": [ - 6 + 12 ] } ], "properties": { + "Node name for S&R": "GenerateStructuredPromptNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + 123456, + "randomize" + ] + }, + { + "id": 1, + "type": "GenerateImageNodeV2", + "pos": [ + 482.9381103515625, + 222.8486785888672 + ], + "size": [ + 270, + 314 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "structured_prompt", + "shape": 7, + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 9 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 10 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 1 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": [ + 13 + ] + }, + { + "name": "seed", + "type": "INT", + "links": [ + 15 + ] + } + ], + "properties": { + "Node name for S&R": "GenerateImageNodeV2", "cnr_id": "comfyui-bria-api", - "ver": "2.1.5", - "Node name for S&R": "GenerateImageNodeV2" + "ver": "2.1.4", + "ue_properties": { + "widget_ue_connectable": { + "api_token": true, + "prompt": true, + "model_version": true, + "negative_prompt": true, + "aspect_ratio": true, + "steps_num": true, + "guidance_scale": true, + "seed": true + }, + "version": "7.1", + "input_ue_unconnectable": {} + } }, "widgets_values": [ "BRIA_API_TOKEN", @@ -452,8 +355,226 @@ 50, 5, 123456, + "randomize", "randomize" ] + }, + { + "id": 17, + "type": "RefineImageNodeV2", + "pos": [ + 876.5194091796875, + 234.5377655029297 + ], + "size": [ + 287.4712829589844, + 314 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [ + { + "name": "structured_prompt", + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 13 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 15 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 16 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": null + }, + { + "name": "seed", + "type": "INT", + "links": null + } + ], + "properties": { + "Node name for S&R": "RefineImageNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + "FIBO", + "1:1", + 50, + 5, + 123456, + "randomize", + "" + ] + }, + { + "id": 7, + "type": "GenerateImageNodeV2", + "pos": [ + 482.86688232421875, + 1034.027099609375 + ], + "size": [ + 270, + 314 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "shape": 7, + "type": "IMAGE", + "link": null + }, + { + "name": "structured_prompt", + "shape": 7, + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 11 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 12 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 8 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": [ + 17 + ] + }, + { + "name": "seed", + "type": "INT", + "links": [ + 18 + ] + } + ], + "properties": { + "Node name for S&R": "GenerateImageNodeV2", + "cnr_id": "comfyui-bria-api", + "ver": "2.1.5" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "FIBO", + "", + "1:1", + 50, + 5, + 123456, + "randomize", + "randomize" + ] + }, + { + "id": 18, + "type": "RefineImageNodeV2", + "pos": [ + 915.1214599609375, + 1000.7938842773438 + ], + "size": [ + 287.4712829589844, + 314 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "structured_prompt", + "type": "STRING", + "widget": { + "name": "structured_prompt" + }, + "link": 17 + }, + { + "name": "seed", + "shape": 7, + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 18 + } + ], + "outputs": [ + { + "name": "image", + "type": "IMAGE", + "links": [ + 19 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": null + }, + { + "name": "seed", + "type": "INT", + "links": null + } + ], + "properties": { + "Node name for S&R": "RefineImageNodeV2" + }, + "widgets_values": [ + "BRIA_API_TOKEN", + "", + "", + "FIBO", + "1:1", + 50, + 5, + 123456, + "randomize", + "" + ] } ], "links": [ @@ -465,54 +586,6 @@ 0, "IMAGE" ], - [ - 2, - 1, - 2, - 2, - 1, - "INT" - ], - [ - 3, - 1, - 1, - 2, - 0, - "STRING" - ], - [ - 4, - 2, - 0, - 4, - 0, - "IMAGE" - ], - [ - 5, - 7, - 1, - 9, - 0, - "STRING" - ], - [ - 6, - 7, - 2, - 9, - 1, - "INT" - ], - [ - 7, - 9, - 0, - 10, - 0, - "IMAGE" - ], [ 8, 7, @@ -520,20 +593,100 @@ 14, 0, "IMAGE" + ], + [ + 9, + 16, + 0, + 1, + 1, + "STRING" + ], + [ + 10, + 16, + 1, + 1, + 2, + "INT" + ], + [ + 11, + 15, + 0, + 7, + 1, + "STRING" + ], + [ + 12, + 15, + 1, + 7, + 2, + "INT" + ], + [ + 13, + 1, + 1, + 17, + 0, + "STRING" + ], + [ + 15, + 1, + 2, + 17, + 1, + "INT" + ], + [ + 16, + 17, + 0, + 4, + 0, + "IMAGE" + ], + [ + 17, + 7, + 1, + 18, + 0, + "STRING" + ], + [ + 18, + 7, + 2, + 18, + 1, + "INT" + ], + [ + 19, + 18, + 0, + 10, + 0, + "IMAGE" ] ], "groups": [], "config": {}, "extra": { - "ue_links": [], "ds": { - "scale": 0.3897342147473183, + "scale": 0.6904379352119744, "offset": [ - 658.5745748406673, - 99.37411299539059 + 213.80311902834225, + -667.3066536880174 ] }, - "frontendVersion": "1.28.4", + "frontendVersion": "1.25.11", + "ue_links": [], "VHS_latentpreview": false, "VHS_latentpreviewrate": 0, "VHS_MetadataImage": true,