diff --git a/nodes/fibo_edit_node.py b/nodes/fibo_edit_node.py index 511d103..107cedd 100644 --- a/nodes/fibo_edit_node.py +++ b/nodes/fibo_edit_node.py @@ -21,10 +21,10 @@ class FIBOEditNode: return { "required": { "api_token": ("STRING", {"default": "BRIA_API_TOKEN"}), - "instruction": ("STRING",), "images": ("IMAGE",), }, "optional": { + "instruction": ("STRING",), "mask": ("MASK",), "structured_instruction": ("STRING",), "negative_prompt": ("STRING",), @@ -49,7 +49,7 @@ class FIBOEditNode: } RETURN_TYPES = ("IMAGE", "STRING", "INT") - RETURN_NAMES = ("IMAGE", "structured_prompt", "seed") + RETURN_NAMES = ("IMAGE", "structured_instruction", "seed") CATEGORY = "API Nodes" FUNCTION = "execute" @@ -75,7 +75,6 @@ class FIBOEditNode: processed_images = images payload = { - "instruction": instruction, "images": [image_to_base64(processed_images)], "steps_num": steps_num, "guidance_scale": guidance_scale, @@ -93,7 +92,9 @@ class FIBOEditNode: # Add optional structured_instruction if structured_instruction: payload["structured_instruction"] = structured_instruction - + # Add optional structured_instruction + if instruction: + payload["instruction"] = instruction # Add optional negative_prompt if negative_prompt: payload["negative_prompt"] = negative_prompt diff --git a/pyproject.toml b/pyproject.toml index 92deb86..80581a8 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.13" +version = "2.1.14" license = {file = "LICENSE"} [project.urls] diff --git a/workflows/Fibo_edit_workflow.json b/workflows/Fibo_edit_workflow.json new file mode 100644 index 0000000..a6208dd --- /dev/null +++ b/workflows/Fibo_edit_workflow.json @@ -0,0 +1,331 @@ +{ + "id": "3eb93704-25f0-4511-b147-cf0403c5d060", + "revision": 0, + "last_node_id": 8, + "last_link_id": 9, + "nodes": [ + { + "id": 2, + "type": "LoadImage", + "pos": [ + -245.09060668945312, + 882.640869140625 + ], + "size": [ + 274.080078125, + 314 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 4, + 6, + 8 + ] + }, + { + "name": "MASK", + "type": "MASK", + "links": null + } + ], + "properties": { + "Node name for S&R": "LoadImage" + }, + "widgets_values": [ + "0a9d91e579872d653daf3243df4598f0 (2).png", + "image" + ] + }, + { + "id": 7, + "type": "PreviewImage", + "pos": [ + 756.945556640625, + 406.1631774902344 + ], + "size": [ + 140, + 246 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 9 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 6, + "type": "PreviewImage", + "pos": [ + 702.7532348632812, + 830.3753662109375 + ], + "size": [ + 140, + 246 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 5 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 8, + "type": "FIBOEditNode", + "pos": [ + 390.8927307128906, + 339.14031982421875 + ], + "size": [ + 278.720703125, + 266 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 8 + }, + { + "name": "mask", + "shape": 7, + "type": "MASK", + "link": null + }, + { + "name": "structured_instruction", + "shape": 7, + "type": "STRING", + "widget": { + "name": "structured_instruction" + }, + "link": 7 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 9 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": null + }, + { + "name": "seed", + "type": "INT", + "links": null + } + ], + "properties": { + "Node name for S&R": "FIBOEditNode" + }, + "widgets_values": [ + "", + "", + "", + "", + 50, + 5, + 1199, + "randomize" + ] + }, + { + "id": 5, + "type": "FIBOEditStructuredInstructionNode", + "pos": [ + -122.1817626953125, + 435.91400146484375 + ], + "size": [ + 314.6372985839844, + 82 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 6 + } + ], + "outputs": [ + { + "name": "structured_instruction", + "type": "STRING", + "links": [ + 7 + ] + } + ], + "properties": { + "Node name for S&R": "FIBOEditStructuredInstructionNode" + }, + "widgets_values": [ + "", + "change the lamp to a coffee mug" + ] + }, + { + "id": 4, + "type": "FIBOEditNode", + "pos": [ + 301.3495788574219, + 884.5100708007812 + ], + "size": [ + 278.720703125, + 266 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 4 + }, + { + "name": "mask", + "shape": 7, + "type": "MASK", + "link": null + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 5 + ] + }, + { + "name": "structured_prompt", + "type": "STRING", + "links": null + }, + { + "name": "seed", + "type": "INT", + "links": null + } + ], + "properties": { + "Node name for S&R": "FIBOEditNode" + }, + "widgets_values": [ + "", + "change the lamp to a radio", + "", + "", + 50, + 5, + 55, + "randomize" + ] + } + ], + "links": [ + [ + 4, + 2, + 0, + 4, + 0, + "IMAGE" + ], + [ + 5, + 4, + 0, + 6, + 0, + "IMAGE" + ], + [ + 6, + 2, + 0, + 5, + 0, + "IMAGE" + ], + [ + 7, + 5, + 0, + 8, + 2, + "STRING" + ], + [ + 8, + 2, + 0, + 8, + 0, + "IMAGE" + ], + [ + 9, + 8, + 0, + 7, + 0, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.7522123482651067, + "offset": [ + 958.445911560887, + -236.63172581276325 + ] + }, + "frontendVersion": "1.25.11" + }, + "version": 0.4 +} \ No newline at end of file