diff --git a/Readme.md b/Readme.md index cd60984..ca81559 100644 --- a/Readme.md +++ b/Readme.md @@ -1,43 +1,63 @@ # BRIA ComfyUI API Nodes -## Overview -This repository contains custom nodes for ComfyUI that allow access to BRIA's API endpoints. You can find our API documentation [here](https://bria-ai-api-docs.redoc.ly/#operation//generation/bria-v2/text-to-image). +

+ BRIA Logo +

-To use the nodes in the workflow, you need a valid BRIA API token. You can get one [here](https://bria.ai/api/) (with 1000 free calls) +This repository provides custom nodes for ComfyUI, enabling direct access to **BRIA's API endpoints** for image generation workflows. **API documentation** is available [**here**](https://bria-ai-api-docs.redoc.ly/#operation//generation/bria-v2/text-to-image). -You can load the different workflows, by importing the compatible workflow.json files in this [folder](workflows). +An API token is required to use the nodes in your workflows. Get started quickly here + + Get Your Token +. -An illustration of our workflows: - - all workflows example all workflows example - -## Available Nodes - -### Eraser -The **Eraser** node allows users to remove specific objects or areas from an image by providing a mask. - -This functionality is powered by BRIA's ControlNet inpainting, available on [this model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Inpainting) on Hugging Face. - -You can also try out BRIA's Eraser demo by visiting our Hugging Face space [here](https://huggingface.co/spaces/briaai/BRIA-Eraser-API). - -### GenFill -The **GenFill** node allows users to add and modify objects or areas in an image by providing a mask and a prompt. - -This functionality is powered by BRIA's ControlNet Generative Fill, available on [this model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Generative-Fill) on Hugging Face. - -You can also try out BRIA's Generative Fill demo by visiting our Hugging Face space [here](https://huggingface.co/spaces/briaai/BRIA-Generative-Fill-API). - -### Product Shot Generation -The **ShotByText** node allows users to modify the background in an image by providing a prompt. - -The **ShotByImage** node allows users to modify the background in an image by providing a reference image. - -This functionality is powered by BRIA's ControlNet Background-Generation and BRIA's Image-Prompt, available on [this model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-BG-Gen) and [this model card](https://huggingface.co/briaai/Image-Prompt) respectively on Hugging Face. - -You can also try out BRIA's ShotByText and ShotByImage demos by visiting our Hugging Face space [here](https://huggingface.co/spaces/briaai/Product-Shot-Generation). +To load a workflow, import the compatible workflow.json files from this [folder](workflows). -## Installation + + + + + +# Coming soon + +- [ ] Video Editing + +# Available Nodes + +## Image Generation Nodes + +### **Text2Image Base Node** +This node generates images from text prompts, serving as the foundation for creating visuals based on descriptive input. [[🤗model card](https://huggingface.co/briaai/BRIA-2.3)] + +## Tailored Generation Nodes +These nodes use pre-trained tailored models to generate images that faithfully reproduce specific visual IP elements or guidelines. [[API docs](https://bria-ai-api-docs.redoc.ly/tag/Tailored-Generation)]. + +### **Tailored Gen** +This node generates images using a trained tailored model, faithfully reproducing specific visual IP elements or guidelines established during model training. + +### **Tailored Model Info** +This node retrieves the **default settings** and **prompt prefix** of a **trained tailored model**. It provides the necessary information to configure and run the model in the **Tailored Gen node**, ensuring consistency with the model's intended behavior. + +## Image Editing Nodes +These nodes modify specific parts of images, enabling adjustments, while maintaining the integrity of the rest of the image.[[API docs](https://bria-ai-api-docs.redoc.ly/tag/Image-Editing)] + +### **Eraser** +This node is used to remove specific objects or areas from an image by providing a mask. Powered by BRIA's ControlNet inpainting [[🤗model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Inpainting)] [[🤗HF demo](https://huggingface.co/spaces/briaai/BRIA-Eraser-API)]. + +### **GenFill** +This node is used to generate objects by prompt in a specific region of an image. This functionality is powered by BRIA's ControlNet Generative Fill. [[🤗model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Generative-Fill)] [[🤗HF demo](https://huggingface.co/spaces/briaai/BRIA-Generative-Fill-API)] + +## Product Shot Generation Nodes +These nodes create high-quality product images for eCommerce workflows. [[API docs](https://bria-ai-api-docs.redoc.ly/tag/Product-Shots-Generation)] + +### **ShotByText** +This node is used to modify the background in an image by providing a prompt, This functionality is powered by BRIA's ControlNet Background-Generation.[[🤗ContrlNet model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-BG-Gen)] [[🤗HF demo](https://huggingface.co/spaces/briaai/Product-Shot-Generation)]. + +### **ShotByImage** +This node is used to modify the background in an image by providing a reference image. This functionality is powered by BRIA's ControlNet Background-Generation and BRIA's Image-Prompt. [[🤗ContrlNet model card](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Inpainting)] [[🤗IP-Adapter model card](https://huggingface.co/briaai/Image-Prompt)] [[🤗HF demo](https://huggingface.co/spaces/briaai/Product-Shot-Generation)]. + +# Installation There are two methods to install the BRIA ComfyUI API nodes: ### Method 1: Using ComfyUI's Custom Node Manager @@ -56,3 +76,6 @@ There are two methods to install the BRIA ComfyUI API nodes: ``` 3. Restart ComfyUI and load the workflows. + + diff --git a/images/Bria Logo.svg b/images/Bria Logo.svg new file mode 100644 index 0000000..cbc33db --- /dev/null +++ b/images/Bria Logo.svg @@ -0,0 +1,21 @@ + + + + + + diff --git a/nodes/shot_by_image_node.py b/nodes/shot_by_image_node.py index 6ee1647..eaeb282 100644 --- a/nodes/shot_by_image_node.py +++ b/nodes/shot_by_image_node.py @@ -21,7 +21,7 @@ class ShotByImageNode(): FUNCTION = "execute" # This is the method that will be executed def __init__(self): - super().__init__("https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_image") # Eraser API URL + self.api_url = "https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_image" # Eraser API URL # Define the execute method as expected by ComfyUI def execute(self, image, ref_image, api_key, enhance_ref_image, ): diff --git a/workflows/tailored_workflow.json b/workflows/tailored_workflow.json index 317b824..ba475e6 100644 --- a/workflows/tailored_workflow.json +++ b/workflows/tailored_workflow.json @@ -1,314 +1 @@ -{ - "last_node_id": 18, - "last_link_id": 49, - "nodes": [ - { - "id": 2, - "type": "TailoredModelInfoNode", - "pos": [ - 480.2208557128906, - 641.4290161132812 - ], - "size": [ - 315, - 122 - ], - "flags": {}, - "order": 0, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "generation_prefix", - "type": "STRING", - "links": [ - 2 - ], - "slot_index": 0 - }, - { - "name": "default_fast", - "type": "INT", - "links": [ - 46 - ], - "slot_index": 1 - }, - { - "name": "default_steps_num", - "type": "INT", - "links": [ - 40 - ], - "slot_index": 2 - } - ], - "properties": { - "Node name for S&R": "TailoredModelInfoNode" - }, - "widgets_values": [ - "", - "" - ] - }, - { - "id": 3, - "type": "PreviewImage", - "pos": [ - 1728.9140625, - 688.2759399414062 - ], - "size": [ - 210, - 246 - ], - "flags": {}, - "order": 4, - "mode": 0, - "inputs": [ - { - "name": "images", - "type": "IMAGE", - "link": 41 - } - ], - "outputs": [], - "properties": { - "Node name for S&R": "PreviewImage" - }, - "widgets_values": [] - }, - { - "id": 11, - "type": "LoadImage", - "pos": [ - 693.87060546875, - 831.6130981445312 - ], - "size": [ - 315, - 314 - ], - "flags": {}, - "order": 1, - "mode": 0, - "inputs": [], - "outputs": [ - { - "name": "IMAGE", - "type": "IMAGE", - "links": [ - 48 - ], - "slot_index": 0 - }, - { - "name": "MASK", - "type": "MASK", - "links": null - } - ], - "properties": { - "Node name for S&R": "LoadImage" - }, - "widgets_values": [ - "example.png", - "image" - ] - }, - { - "id": 5, - "type": "JjkShowText", - "pos": [ - 847.2867431640625, - 591.890625 - ], - "size": [ - 315, - 76 - ], - "flags": {}, - "order": 2, - "mode": 0, - "inputs": [ - { - "name": "text", - "type": "STRING", - "link": 2, - "widget": { - "name": "text" - } - } - ], - "outputs": [ - { - "name": "text", - "type": "STRING", - "links": [ - 49 - ], - "shape": 6, - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "JjkShowText" - }, - "widgets_values": [ - "A photo of a character named Sami, a siamese cat with blue eyes, " - ] - }, - { - "id": 15, - "type": "BriaTailoredGen", - "pos": [ - 1207.595947265625, - 645.6781005859375 - ], - "size": [ - 456, - 438 - ], - "flags": {}, - "order": 3, - "mode": 0, - "inputs": [ - { - "name": "guidance_method_1_image", - "type": "IMAGE", - "link": 48, - "shape": 7 - }, - { - "name": "guidance_method_2_image", - "type": "IMAGE", - "link": null, - "shape": 7 - }, - { - "name": "generation_prefix", - "type": "STRING", - "link": 49, - "widget": { - "name": "generation_prefix" - }, - "shape": 7 - }, - { - "name": "fast", - "type": "INT", - "link": 46, - "widget": { - "name": "fast" - }, - "shape": 7 - }, - { - "name": "steps_num", - "type": "INT", - "link": 40, - "widget": { - "name": "steps_num" - }, - "shape": 7 - } - ], - "outputs": [ - { - "name": "output_image", - "type": "IMAGE", - "links": [ - 41 - ], - "slot_index": 0 - } - ], - "properties": { - "Node name for S&R": "BriaTailoredGen" - }, - "widgets_values": [ - "", - "", - "a cat", - "", - "4:3", - -1, - "randomize", - 1, - "", - "", - 1, - "controlnet_canny", - 1, - "controlnet_canny", - 1 - ] - } - ], - "links": [ - [ - 2, - 2, - 0, - 5, - 0, - "STRING" - ], - [ - 40, - 2, - 2, - 15, - 4, - "INT" - ], - [ - 41, - 15, - 0, - 3, - 0, - "IMAGE" - ], - [ - 46, - 2, - 1, - 15, - 3, - "INT" - ], - [ - 48, - 11, - 0, - 15, - 0, - "IMAGE" - ], - [ - 49, - 5, - 0, - 15, - 2, - "STRING" - ] - ], - "groups": [], - "config": {}, - "extra": { - "ds": { - "scale": 1.1000000000000005, - "offset": [ - -364.273414711815, - -462.01869857932076 - ] - }, - "node_versions": { - "comfy-core": "v0.3.10-35-g916d1e1", - "ComfyUI-Jjk-Nodes": "b3c99bb78a99551776b5eab1a820e1cd58f84f31" - } - }, - "version": 0.4 -} \ No newline at end of file +{"last_node_id":21,"last_link_id":49,"nodes":[{"id":2,"type":"TailoredModelInfoNode","pos":[480.2208557128906,641.4290161132812],"size":[315,122],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"generation_prefix","type":"STRING","links":[2],"slot_index":0,"localized_name":"generation_prefix"},{"name":"default_fast","type":"INT","links":[46],"slot_index":1,"localized_name":"default_fast"},{"name":"default_steps_num","type":"INT","links":[40],"slot_index":2,"localized_name":"default_steps_num"}],"properties":{"Node name for S&R":"TailoredModelInfoNode"},"widgets_values":["",""]},{"id":3,"type":"PreviewImage","pos":[1728.9140625,688.2759399414062],"size":[210,246],"flags":{},"order":6,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":41,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":11,"type":"LoadImage","pos":[693.87060546875,831.6130981445312],"size":[315,314],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[48],"slot_index":0,"localized_name":"IMAGE"},{"name":"MASK","type":"MASK","links":null,"localized_name":"MASK"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["example.png","image"]},{"id":5,"type":"JjkShowText","pos":[847.2867431640625,591.890625],"size":[315,76],"flags":{},"order":4,"mode":0,"inputs":[{"name":"text","type":"STRING","link":2,"widget":{"name":"text"}}],"outputs":[{"name":"text","type":"STRING","links":[49],"slot_index":0,"shape":6,"localized_name":"text"}],"properties":{"Node name for S&R":"JjkShowText"},"widgets_values":["A photo of a character named Sami, a siamese cat with blue eyes, "]},{"id":15,"type":"BriaTailoredGen","pos":[1207.595947265625,645.6781005859375],"size":[456,438],"flags":{},"order":5,"mode":0,"inputs":[{"name":"guidance_method_1_image","type":"IMAGE","link":48,"shape":7,"localized_name":"guidance_method_1_image"},{"name":"guidance_method_2_image","type":"IMAGE","link":null,"shape":7,"localized_name":"guidance_method_2_image"},{"name":"generation_prefix","type":"STRING","link":49,"widget":{"name":"generation_prefix"},"shape":7},{"name":"fast","type":"INT","link":46,"widget":{"name":"fast"},"shape":7},{"name":"steps_num","type":"INT","link":40,"widget":{"name":"steps_num"},"shape":7}],"outputs":[{"name":"output_image","type":"IMAGE","links":[41],"slot_index":0,"localized_name":"output_image"}],"properties":{"Node name for S&R":"BriaTailoredGen"},"widgets_values":["","","a cat","","4:3",-1,"randomize",1,"","",1,"controlnet_canny",1,"controlnet_canny",1]},{"id":21,"type":"Note","pos":[1215.2469482421875,522.4407348632812],"size":[449.75360107421875,58],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["You can get your BRIA API token at: https://bria.ai/api/"],"color":"#432","bgcolor":"#653"},{"id":19,"type":"Note","pos":[484.5993957519531,486.4328918457031],"size":[306.0655212402344,89.87609100341797],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["This node is used to retrieve default settings and prompt prefixes for the chosen tailored model."],"color":"#432","bgcolor":"#653"}],"links":[[2,2,0,5,0,"STRING"],[40,2,2,15,4,"INT"],[41,15,0,3,0,"IMAGE"],[46,2,1,15,3,"INT"],[48,11,0,15,0,"IMAGE"],[49,5,0,15,2,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.7627768444385483,"offset":[-122.90473166350671,-300.2018923615813]},"node_versions":{"comfyui-bria-api":"c72754d15b53a13ee0c0419d70401232c56b7fdb","comfy-core":"v0.3.8-1-gc441048","ComfyUI-Jjk-Nodes":"b3c99bb78a99551776b5eab1a820e1cd58f84f31"}},"version":0.4} \ No newline at end of file