Compare commits
102
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5d4d41bb8 | ||
|
|
0f2b1115c5 | ||
|
|
b408c8781a | ||
|
|
f6e134cfd3 | ||
|
|
7855c4dba2 | ||
|
|
c1f67dd4fb | ||
|
|
c1a77106b4 | ||
|
|
0f170bfc6b | ||
|
|
6b4b9e2dee | ||
|
|
4385a8c429 | ||
|
|
dd8d70000f | ||
|
|
582e16600e | ||
|
|
33f657ccbd | ||
|
|
f8a6650b4b | ||
|
|
493d23bdcb | ||
|
|
ecf52dd764 | ||
|
|
a9f894102d | ||
|
|
e50dd5dd63 | ||
|
|
00ce39dae5 | ||
|
|
270128d32a | ||
|
|
513fec79b5 | ||
|
|
ddbf7d0695 | ||
|
|
43893286cc | ||
|
|
3befc0a2ac | ||
|
|
af6ef2a829 | ||
|
|
96d2924dfc | ||
|
|
327ace887b | ||
|
|
bc5dacb9ef | ||
|
|
fc8aa8b6a7 | ||
|
|
9960a93044 | ||
|
|
8d3eef85ca | ||
|
|
bb4108b6c4 | ||
|
|
18a5ffbcca | ||
|
|
4f3b7fb77a | ||
|
|
c3b5fea335 | ||
|
|
b8e40e90bc | ||
|
|
9b3f15b7bd | ||
|
|
f7c9ed12b0 | ||
|
|
bdd053a81b | ||
|
|
2913a9eb6b | ||
|
|
080c17f4a4 | ||
|
|
711080ffb0 | ||
|
|
69f111bfe9 | ||
|
|
011f728b0d | ||
|
|
ac9678cd23 | ||
|
|
daede982ac | ||
|
|
e716e585df | ||
|
|
1296b6a27c | ||
|
|
19f15f4ba4 | ||
|
|
30d0154caf | ||
|
|
283665f654 | ||
|
|
03e3bec952 | ||
|
|
f1793ba9ad | ||
|
|
eda093ea66 | ||
|
|
165a103f0c | ||
|
|
ad2f4a5853 | ||
|
|
43f858dca4 | ||
|
|
538cd53ac8 | ||
|
|
bae0ed3842 | ||
|
|
a164f8ec45 | ||
|
|
ebe9e2e6b1 | ||
|
|
429c51ac6d | ||
|
|
aed4832984 | ||
|
|
a78aff0fb2 | ||
|
|
6edfc55109 | ||
|
|
00dccbb17a | ||
|
|
1cb9ce4394 | ||
|
|
b2f8b8d0e3 | ||
|
|
129bc599d0 | ||
|
|
28c2631581 | ||
|
|
baadbc02bc | ||
|
|
a73045f8e6 | ||
|
|
dd74d03fd0 | ||
|
|
bfc83da41f | ||
|
|
499ec5d104 | ||
|
|
fef2e49902 | ||
|
|
2eae6dae46 | ||
|
|
28c0cdf8d5 | ||
|
|
54f380f1f0 | ||
|
|
4f7691ff93 | ||
|
|
1781beff09 | ||
|
|
502206f518 | ||
|
|
da8adda281 | ||
|
|
1c02dea96b | ||
|
|
5b77fd90a8 | ||
|
|
246e05ac3e | ||
|
|
b6f2f8b297 | ||
|
|
5052a7bf94 | ||
|
|
afc9599c63 | ||
|
|
13a3dfb2bb | ||
|
|
6573f2e43d | ||
|
|
ac7e97c348 | ||
|
|
c6fe701115 | ||
|
|
ab17ee227d | ||
|
|
2fa966e887 | ||
|
|
3b5cca2dc8 | ||
|
|
aaf0729f78 | ||
|
|
1a37414fe4 | ||
|
|
2fbbce0d1b | ||
|
|
23f9e46eff | ||
|
|
a4855c1a1a | ||
|
|
709d16cb72 |
@@ -7,17 +7,19 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "pyproject.toml"
|
- "pyproject.toml"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-node:
|
publish-node:
|
||||||
name: Publish Custom Node to registry
|
name: Publish Custom Node to registry
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# if this is a forked repository. Skipping the workflow.
|
if: ${{ github.repository_owner == 'Bria-AI' }}
|
||||||
if: github.event.repository.fork == false
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Publish Custom Node
|
- name: Publish Custom Node
|
||||||
uses: Comfy-Org/publish-node-action@main
|
uses: Comfy-Org/publish-node-action@v1
|
||||||
with:
|
with:
|
||||||
## Add your own personal access token to your Github Repository secrets and reference it here.
|
## Add your own personal access token to your Github Repository secrets and reference it here.
|
||||||
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
|
.idea
|
||||||
@@ -4,14 +4,22 @@
|
|||||||
<img src="./images/Bria Logo.svg" alt="BRIA Logo" width="200"/>
|
<img src="./images/Bria Logo.svg" alt="BRIA Logo" width="200"/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
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).
|
This repository provides custom nodes for ComfyUI, enabling direct access to **BRIA's API endpoints** for image generation and editing workflows. **API documentation** is available [**here**](https://docs.bria.ai/).
|
||||||
|
|
||||||
|
BRIA's APIs and models are built for commercial use and trained on 100% licensed data and does not contain copyrighted materials, such as fictional characters, logos, trademarks, public figures, harmful content, or privacy-infringing content.
|
||||||
|
|
||||||
An API token is required to use the nodes in your workflows. Get started quickly here
|
An API token is required to use the nodes in your workflows. Get started quickly here
|
||||||
<a href="https://bria.ai/api/" style="text-decoration:none; vertical-align:middle;">
|
<a href="https://bria.ai/api/" style="text-decoration:none; vertical-align:middle;">
|
||||||
<img src="https://img.shields.io/badge/GET%20YOUR%20TOKEN-1000%20Free%20Calls-blue?style=flat-square" alt="Get Your Token" height="20">
|
<img src="https://img.shields.io/badge/GET%20YOUR%20TOKEN-1000%20Free%20Calls-blue?style=flat-square" alt="Get Your Token" height="20">
|
||||||
</a>.
|
</a>.
|
||||||
|
|
||||||
|
for direct API endpoint use, you can find our APIs through partners like [**fal.ai**](https://fal.ai/models?keywords=bria).
|
||||||
|
For source code and weigths access, go to our [**Hugging Face**](https://huggingface.co/briaai) space.
|
||||||
|
|
||||||
To load a workflow, import the compatible workflow.json files from this [folder](workflows).
|
To load a workflow, import the compatible workflow.json files from this [folder](workflows).
|
||||||
|
<p align="center">
|
||||||
|
<img src="./images/background_workflow.png" width="1200"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<!-- Placeholder image of cool workflows. -->
|
<!-- Placeholder image of cool workflows. -->
|
||||||
@@ -19,43 +27,69 @@ To load a workflow, import the compatible workflow.json files from this [folder]
|
|||||||
|
|
||||||
<!-- <img src="./images/bria_api_nodes_workflow_diagram.png" alt="all workflows example" width="400"/> <img src="./images/bria_api_nodes_workflow_diagram_2.png" alt="all workflows example" width="400"/> -->
|
<!-- <img src="./images/bria_api_nodes_workflow_diagram.png" alt="all workflows example" width="400"/> <img src="./images/bria_api_nodes_workflow_diagram_2.png" alt="all workflows example" width="400"/> -->
|
||||||
|
|
||||||
# Coming soon
|
|
||||||
|
|
||||||
- [ ] Video Editing
|
|
||||||
|
|
||||||
# Available Nodes
|
# Available Nodes
|
||||||
|
|
||||||
## Image Generation Nodes
|
## Image Generation Nodes
|
||||||
|
|
||||||
### **Text2Image Base Node**
|
These nodes allow you to leverage Bria's image generation capabilities within ComfyUI. We offer our latest **V2 nodes** designed for precise control via structured prompts (currently powered by the **FIBO** model), alongside our **V1 nodes** for various established pipelines.
|
||||||
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)]
|
|
||||||
|
### V2 Generation Nodes
|
||||||
|
|
||||||
|
These nodes generate images based on detailed **structured prompts** for enhanced control and consistency. They are currently powered by the state-of-the-art **FIBO** text-to-image model.
|
||||||
|
|
||||||
|
| **Node** | **Description** |
|
||||||
|
| --- | --- |
|
||||||
|
| **Generate Image** | Creates new images from text or image inputs. Internally translates the input into a structured prompt using a selected VLM bridge before generating with the image model. |
|
||||||
|
| **Refine and Regenerate Image** | Refines a generated image using a provided `structured_prompt` (from a previous generation) and a refinement text prompt. |
|
||||||
|
|
||||||
|
### V1 Generation Nodes
|
||||||
|
|
||||||
|
These nodes create high-quality images using Bria's V1 pipelines, supporting various aspect ratios and styles.
|
||||||
|
|
||||||
|
| Node | Description |
|
||||||
|
|------------------------|--------------------------------------------------------------------|
|
||||||
|
| **Text2Image Base** | Generates images from text prompts, serving as the foundation for text-based image creation. |
|
||||||
|
| **Text2Image Fast** | Optimized for speed, this node generates images from text prompts with faster results while maintaining quality. |
|
||||||
|
| **Text2Image HD** | Optimized for high-resolution outputs, this node generates detailed and sharp visuals from text prompts. |
|
||||||
|
| **Reimagine** | Guides image generation using both prompts and an input image. Preserve the original structure and depth while introducing new materials, colors, and textures. |
|
||||||
|
|
||||||
## Tailored Generation Nodes
|
## 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)].
|
These nodes use pre-trained tailored models to generate images that faithfully reproduce specific visual IP elements or guidelines.
|
||||||
|
|
||||||
### **Tailored Gen**
|
| Node | Description |
|
||||||
This node generates images using a trained tailored model, faithfully reproducing specific visual IP elements or guidelines established during model training.
|
|------------------------|--------------------------------------------------------------------|
|
||||||
|
| **Tailored Gen** | Generates images using a trained tailored model, reproducing specific visual IP elements or guidelines. Use the Tailored Model Info node to load the model's default settings. |
|
||||||
### **Tailored Model Info**
|
| **Tailored Model Info**| Retrieves the default settings and prompt prefix of a trained tailored model, which can be used to configure the Tailored Gen node. |
|
||||||
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.
|
| **Restyle Portrait** | Transforms the style of a portrait while preserving the person's facial features. |
|
||||||
|
|
||||||
## Image Editing Nodes
|
## 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)]
|
These nodes modify specific parts of images, enabling adjustments while maintaining the integrity of the rest of the image.
|
||||||
|
|
||||||
### **Eraser**
|
| Node | Description |
|
||||||
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)].
|
|------------------------|--------------------------------------------------------------------|
|
||||||
|
| **RMBG 2.0 (Remove Background)** | Removes the background from an image, isolating the foreground subject. |
|
||||||
|
| **Replace Background** | Replaces an image’s background with a new one, guided by either a reference image or a prompt. |
|
||||||
|
| **Expand Image** | Expands the dimensions of an image, generating new content to fill the extended areas. |
|
||||||
|
| **Eraser** | Removes specific objects or areas from an image by providing a mask. |
|
||||||
|
| **GenFill** | Generates objects by prompt in a specific region of an image. |
|
||||||
|
| **Erase Foreground** | Removes the foreground from an image, isolating the background. |
|
||||||
|
|
||||||
### **GenFill**
|
## Product Shot Editing Nodes
|
||||||
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)]
|
These nodes create high-quality product images for eCommerce workflows.
|
||||||
|
|
||||||
|
| Node | Description |
|
||||||
|
|------------------------|--------------------------------------------------------------------|
|
||||||
|
| **ShotByText** | Modifies an image's background by providing a text prompt. Powered by BRIA's ControlNet Background-Generation. |
|
||||||
|
| **ShotByImage** | Modifies an image's background by providing a reference image. Uses BRIA's ControlNet Background-Generation and Image-Prompt. |
|
||||||
|
|
||||||
|
## Attribution Node
|
||||||
|
|
||||||
|
| Node | Description |
|
||||||
|
|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| **Attribution By Image Node** | This node shares generated images via API for Bria to pay attribution to the data owners who contributed to the generation. Once the images are shared with Bria, Bria calculates the attribution, completes the payment on behalf of the user, and erases the images immediately. This node should be included in any workflow using nodes of Bria’s Models (not necessary for Bria’s API nodes). You can also refer to the [**API documentation**]( https://docs.bria.ai/bria-attribution-service/other/postattributionbyimage) |
|
||||||
|
|
||||||
## 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
|
# Installation
|
||||||
There are two methods to install the BRIA ComfyUI API nodes:
|
There are two methods to install the BRIA ComfyUI API nodes:
|
||||||
|
|||||||
+71
-7
@@ -1,29 +1,93 @@
|
|||||||
from .nodes import (EraserNode, GenFillNode, ShotByTextNode, ShotByImageNode, TailoredGenNode,
|
from .nodes import (
|
||||||
TailoredModelInfoNode, Text2ImageBaseNode, Text2ImageFastNode, Text2ImageHDNode,
|
EraserNode,
|
||||||
ReimagineNode)
|
GenFillNode,
|
||||||
|
ImageExpansionNode,
|
||||||
|
ReplaceBgNode,
|
||||||
|
RmbgNode,
|
||||||
|
RemoveForegroundNode,
|
||||||
|
ShotByTextOriginalNode,
|
||||||
|
ShotByImageOriginalNode,
|
||||||
|
TailoredGenNode,
|
||||||
|
TailoredModelInfoNode,
|
||||||
|
Text2ImageBaseNode,
|
||||||
|
Text2ImageFastNode,
|
||||||
|
Text2ImageHDNode,
|
||||||
|
TailoredPortraitNode,
|
||||||
|
ReimagineNode,
|
||||||
|
GenerateImageNodeV2,
|
||||||
|
RefineImageNodeV2,
|
||||||
|
ShotByTextAutomaticNode,
|
||||||
|
ShotByImageManualPaddingNode,
|
||||||
|
ShotByImageAutomaticAspectRatioNode,
|
||||||
|
ShotByImageCustomCoordinatesNode,
|
||||||
|
ShotByImageManualPlacementNode,
|
||||||
|
ShotByImageAutomaticNode,
|
||||||
|
ShotByTextAutomaticAspectRatioNode,
|
||||||
|
ShotByTextManualPlacementNode,
|
||||||
|
ShotByTextManualPaddingNode,
|
||||||
|
ShotByTextCustomCoordinatesNode,
|
||||||
|
AttributionByImageNode
|
||||||
|
)
|
||||||
|
|
||||||
# Map the node class to a name used internally by ComfyUI
|
# Map the node class to a name used internally by ComfyUI
|
||||||
NODE_CLASS_MAPPINGS = {
|
NODE_CLASS_MAPPINGS = {
|
||||||
"BriaEraser": EraserNode, # Return the class, not an instance
|
"BriaEraser": EraserNode, # Return the class, not an instance
|
||||||
"BriaGenFill": GenFillNode,
|
"BriaGenFill": GenFillNode,
|
||||||
"ShotByTextNode": ShotByTextNode,
|
"ImageExpansionNode": ImageExpansionNode,
|
||||||
"ShotByImageNode": ShotByImageNode,
|
"ReplaceBgNode": ReplaceBgNode,
|
||||||
|
"RmbgNode": RmbgNode,
|
||||||
|
"RemoveForegroundNode": RemoveForegroundNode,
|
||||||
|
"ShotByTextOriginal": ShotByTextOriginalNode,
|
||||||
|
"ShotByImageOriginal": ShotByImageOriginalNode,
|
||||||
|
"ShotByTextAutomatic": ShotByTextAutomaticNode,
|
||||||
|
"ShotByTextManualPlacement": ShotByTextManualPlacementNode,
|
||||||
|
"ShotByTextCustomCoordinates": ShotByTextCustomCoordinatesNode,
|
||||||
|
"ShotByTextManualPadding": ShotByTextManualPaddingNode,
|
||||||
|
"ShotByTextAutomaticAspectRatio": ShotByTextAutomaticAspectRatioNode,
|
||||||
|
"ShotByImageAutomatic": ShotByImageAutomaticNode,
|
||||||
|
"ShotByImageManualPlacement": ShotByImageManualPlacementNode,
|
||||||
|
"ShotByImageCustomCoordinates": ShotByImageCustomCoordinatesNode,
|
||||||
|
"ShotByImageManualPadding": ShotByImageManualPaddingNode,
|
||||||
|
"ShotByImageAutomaticAspectRatio": ShotByImageAutomaticAspectRatioNode,
|
||||||
"BriaTailoredGen": TailoredGenNode,
|
"BriaTailoredGen": TailoredGenNode,
|
||||||
"TailoredModelInfoNode": TailoredModelInfoNode,
|
"TailoredModelInfoNode": TailoredModelInfoNode,
|
||||||
|
"TailoredPortraitNode": TailoredPortraitNode,
|
||||||
"Text2ImageBaseNode": Text2ImageBaseNode,
|
"Text2ImageBaseNode": Text2ImageBaseNode,
|
||||||
"Text2ImageFastNode": Text2ImageFastNode,
|
"Text2ImageFastNode": Text2ImageFastNode,
|
||||||
"Text2ImageHDNode": Text2ImageHDNode,
|
"Text2ImageHDNode": Text2ImageHDNode,
|
||||||
"ReimagineNode": ReimagineNode,
|
"ReimagineNode": ReimagineNode,
|
||||||
|
"AttributionByImageNode": AttributionByImageNode,
|
||||||
|
"GenerateImageNodeV2": GenerateImageNodeV2,
|
||||||
|
"RefineImageNodeV2": RefineImageNodeV2,
|
||||||
}
|
}
|
||||||
# Map the node display name to the one shown in the ComfyUI node interface
|
# Map the node display name to the one shown in the ComfyUI node interface
|
||||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||||
"BriaEraser": "Bria Eraser",
|
"BriaEraser": "Bria Eraser",
|
||||||
"BriaGenFill": "Bria GenFill",
|
"BriaGenFill": "Bria GenFill",
|
||||||
"ShotByTextNode": "Bria Shot By Text",
|
"ImageExpansionNode": "Bria Image Expansion",
|
||||||
"ShotByImageNode": "Bria Shot By Image",
|
"ReplaceBgNode": "Bria Replace Background",
|
||||||
|
"RmbgNode": "Bria RMBG",
|
||||||
|
"RemoveForegroundNode": "Bria Remove Foreground",
|
||||||
|
"ShotByTextOriginal": "Shot by Text - Original",
|
||||||
|
"ShotByImageOriginal": "Shot by Image - Original",
|
||||||
|
"ShotByTextAutomatic": "Shot by Text - Automatic",
|
||||||
|
"ShotByTextManualPlacement": "Shot by Text - Manual Placement",
|
||||||
|
"ShotByTextCustomCoordinates": "Shot by Text - Custom Coordinates",
|
||||||
|
"ShotByTextManualPadding": "Shot by Text - Manual Padding",
|
||||||
|
"ShotByTextAutomaticAspectRatio": "Shot by Text - Automatic Aspect Ratio",
|
||||||
|
"ShotByImageAutomatic": "Shot by Image - Automatic",
|
||||||
|
"ShotByImageManualPlacement": "Shot by Image - Manual Placement",
|
||||||
|
"ShotByImageCustomCoordinates": "Shot by Image - Custom Coordinates",
|
||||||
|
"ShotByImageManualPadding": "Shot by Image - Manual Padding",
|
||||||
|
"ShotByImageAutomaticAspectRatio": "Shot by Image - Automatic Aspect Ratio",
|
||||||
"BriaTailoredGen": "Bria Tailored Gen",
|
"BriaTailoredGen": "Bria Tailored Gen",
|
||||||
"TailoredModelInfoNode": "Bria Tailored Model Info",
|
"TailoredModelInfoNode": "Bria Tailored Model Info",
|
||||||
|
"TailoredPortraitNode": "Bria Restyle Portrait",
|
||||||
"Text2ImageBaseNode": "Bria Text2Image Base",
|
"Text2ImageBaseNode": "Bria Text2Image Base",
|
||||||
"Text2ImageFastNode": "Bria Text2Image Fast",
|
"Text2ImageFastNode": "Bria Text2Image Fast",
|
||||||
"Text2ImageHDNode": "Bria Text2Image HD",
|
"Text2ImageHDNode": "Bria Text2Image HD",
|
||||||
"ReimagineNode": "Bria Reimagine",
|
"ReimagineNode": "Bria Reimagine",
|
||||||
|
"AttributionByImageNode": "Attribution By Image Node",
|
||||||
|
"GenerateImageNodeV2": "Generate Image",
|
||||||
|
"RefineImageNodeV2": "Refine and Regenerate Image",
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 634 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 714 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB |
+22
-2
@@ -1,10 +1,30 @@
|
|||||||
from .eraser_node import EraserNode
|
from .eraser_node import EraserNode
|
||||||
from .generative_fill_node import GenFillNode
|
from .generative_fill_node import GenFillNode
|
||||||
from .shot_by_text_node import ShotByTextNode
|
from .image_expansion_node import ImageExpansionNode
|
||||||
from .shot_by_image_node import ShotByImageNode
|
from .replace_bg_node import ReplaceBgNode
|
||||||
|
from .rmbg_node import RmbgNode
|
||||||
|
from .remove_foreground_node import RemoveForegroundNode
|
||||||
from .tailored_gen_node import TailoredGenNode
|
from .tailored_gen_node import TailoredGenNode
|
||||||
from .tailored_model_info_node import TailoredModelInfoNode
|
from .tailored_model_info_node import TailoredModelInfoNode
|
||||||
|
from .tailored_portrait_node import TailoredPortraitNode
|
||||||
from .text_2_image_base_node import Text2ImageBaseNode
|
from .text_2_image_base_node import Text2ImageBaseNode
|
||||||
from .text_2_image_fast_node import Text2ImageFastNode
|
from .text_2_image_fast_node import Text2ImageFastNode
|
||||||
from .text_2_image_hd_node import Text2ImageHDNode
|
from .text_2_image_hd_node import Text2ImageHDNode
|
||||||
from .reimagine_node import ReimagineNode
|
from .reimagine_node import ReimagineNode
|
||||||
|
from .generate_image_node_v2 import GenerateImageNodeV2
|
||||||
|
from .refine_image_node_v2 import RefineImageNodeV2
|
||||||
|
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
|
||||||
|
from .shot_by_text_custom_coordinates_node import ShotByTextCustomCoordinatesNode
|
||||||
|
from .shot_by_text_manual_placement_node import ShotByTextManualPlacementNode
|
||||||
|
from .shot_by_text_manual_padding_node import ShotByTextManualPaddingNode
|
||||||
|
from .shot_by_image_automatic_aspect_ratio_node import (
|
||||||
|
ShotByImageAutomaticAspectRatioNode,
|
||||||
|
)
|
||||||
|
from .shot_by_image_automatic_node import ShotByImageAutomaticNode
|
||||||
|
from .shot_by_image_custom_coordinates_node import ShotByImageCustomCoordinatesNode
|
||||||
|
from .shot_by_image_node import ShotByImageOriginalNode
|
||||||
|
from .shot_by_image_manual_placement_node import ShotByImageManualPlacementNode
|
||||||
|
from .shot_by_image_manual_padding_node import ShotByImageManualPaddingNode
|
||||||
|
from .attribution_by_image_node import AttributionByImageNode
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import requests
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import deserialize_and_get_comfy_key, preprocess_image, image_to_base64, poll_status_until_completed
|
||||||
|
|
||||||
|
class AttributionByImageNode():
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"image": ("IMAGE",),
|
||||||
|
"model_version": (["2.3", "3.0","3.2"], {"default": "2.3"}),
|
||||||
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("STRING",)
|
||||||
|
RETURN_NAMES = ("api_response",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/attribution/by_image"
|
||||||
|
|
||||||
|
# Define the execute method as expected by ComfyUI
|
||||||
|
def execute(self, image, model_version, api_key):
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
|
||||||
|
# Check if image is tensor, if so, convert to NumPy array
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
# Convert image to base64 for the new API format
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
payload = {
|
||||||
|
"image": image_base64,
|
||||||
|
"model_version": model_version,
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"api_token": f"{api_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
|
print('Initial Attribution via Images API request successful, 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_key)
|
||||||
|
return (str(final_response.get("result",{}).get("content")),)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Error: API request failed with status code {response.status_code} {response.text}")
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
+93
-10
@@ -5,6 +5,16 @@ import torch
|
|||||||
import base64
|
import base64
|
||||||
from torchvision.transforms import ToPILImage
|
from torchvision.transforms import ToPILImage
|
||||||
import requests
|
import requests
|
||||||
|
import time
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
COMFY_KEY_ERROR = (
|
||||||
|
"Invalid Token Type\n\n"
|
||||||
|
"The API token you’ve entered is not a ComfyUI token.\n"
|
||||||
|
"Please use the valid token from your BRIA Account API Keys page:\n"
|
||||||
|
"https://platform.bria.ai/console/account/api-keys"
|
||||||
|
)
|
||||||
|
|
||||||
def postprocess_image(image):
|
def postprocess_image(image):
|
||||||
result_image = Image.open(io.BytesIO(image))
|
result_image = Image.open(io.BytesIO(image))
|
||||||
@@ -44,9 +54,10 @@ def preprocess_mask(mask):
|
|||||||
return mask
|
return mask
|
||||||
|
|
||||||
|
|
||||||
def process_request(api_url, image, mask, api_key):
|
def process_request(api_url, image, mask, api_key, visual_input_content_moderation, visual_output_content_moderation):
|
||||||
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
raise Exception("Please insert a valid API key.")
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
|
||||||
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
||||||
if isinstance(image, torch.Tensor):
|
if isinstance(image, torch.Tensor):
|
||||||
@@ -58,10 +69,12 @@ def process_request(api_url, image, mask, api_key):
|
|||||||
image_base64 = image_to_base64(image)
|
image_base64 = image_to_base64(image)
|
||||||
mask_base64 = image_to_base64(mask)
|
mask_base64 = image_to_base64(mask)
|
||||||
|
|
||||||
# Prepare the API request payload
|
# Prepare the API request payload for v2 API
|
||||||
payload = {
|
payload = {
|
||||||
"file": f"{image_base64}",
|
"image": image_base64,
|
||||||
"mask_file": f"{mask_base64}"
|
"mask": mask_base64,
|
||||||
|
"visual_input_content_moderation":visual_input_content_moderation,
|
||||||
|
"visual_output_content_moderation":visual_output_content_moderation
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
@@ -71,12 +84,22 @@ def process_request(api_url, image, mask, api_key):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.post(api_url, json=payload, headers=headers)
|
response = requests.post(api_url, json=payload, headers=headers)
|
||||||
# Check for successful response
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
if response.status_code == 200:
|
print('Initial request successful, polling for completion...')
|
||||||
print('response is 200')
|
|
||||||
# Process the output image from API response
|
|
||||||
response_dict = response.json()
|
response_dict = response.json()
|
||||||
image_response = requests.get(response_dict['result_url'])
|
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_key)
|
||||||
|
result_image_url = final_response['result']['image_url']
|
||||||
|
|
||||||
|
# Download and process the result image
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
result_image = Image.open(io.BytesIO(image_response.content))
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
result_image = result_image.convert("RGBA")
|
result_image = result_image.convert("RGBA")
|
||||||
result_image = np.array(result_image).astype(np.float32) / 255.0
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
@@ -86,7 +109,67 @@ def process_request(api_url, image, mask, api_key):
|
|||||||
# print(f"output tensor shape is: {image_tensor.shape}")
|
# print(f"output tensor shape is: {image_tensor.shape}")
|
||||||
return (result_image,)
|
return (result_image,)
|
||||||
else:
|
else:
|
||||||
raise Exception(f"Error: API request failed with status code {response.status_code}")
|
raise Exception(f"Error: API request failed with status code {response.status_code} {response.text}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(f"{e}")
|
raise Exception(f"{e}")
|
||||||
|
|
||||||
|
|
||||||
|
def poll_status_until_completed(status_url, api_key, timeout=360, check_interval=2):
|
||||||
|
"""
|
||||||
|
Poll a status URL until the status is COMPLETED or timeout is reached.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
status_url (str): The status URL to poll
|
||||||
|
api_key (str): API token for authentication
|
||||||
|
timeout (int): Maximum time to wait in seconds (default: 360)
|
||||||
|
check_interval (int): Time between checks in seconds (default: 2)
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
dict: The final response containing the result
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
Exception: If timeout is reached or API request fails
|
||||||
|
"""
|
||||||
|
start_time = time.time()
|
||||||
|
headers = {"api_token": api_key}
|
||||||
|
|
||||||
|
while time.time() - start_time < timeout:
|
||||||
|
try:
|
||||||
|
response = requests.get(status_url, headers=headers)
|
||||||
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
|
response_dict = response.json()
|
||||||
|
status = response_dict.get("status", "").upper()
|
||||||
|
|
||||||
|
if status == "COMPLETED":
|
||||||
|
return response_dict
|
||||||
|
elif status == "ERROR":
|
||||||
|
raise Exception(f"Request failed: {response_dict}")
|
||||||
|
else:
|
||||||
|
print(f"Status: {status}, waiting...")
|
||||||
|
time.sleep(check_interval)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Status check failed with status code {response.status_code}")
|
||||||
|
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
raise Exception(f"Error checking status: {e}")
|
||||||
|
|
||||||
|
raise Exception(f"Timeout reached after {timeout} seconds")
|
||||||
|
|
||||||
|
def deserialize_and_get_comfy_key(encoded: str) -> str:
|
||||||
|
"""
|
||||||
|
Decodes a base64-encoded JSON token and returns the ComfyUI API key.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
decoded = base64.b64decode(encoded).decode("utf-8")
|
||||||
|
payload = json.loads(decoded)
|
||||||
|
|
||||||
|
if payload.get("type") != "comfy":
|
||||||
|
raise Exception(COMFY_KEY_ERROR)
|
||||||
|
|
||||||
|
return payload.get("apiKey")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(COMFY_KEY_ERROR)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ class EraserNode():
|
|||||||
"image": ("IMAGE",), # Input image from another node
|
"image": ("IMAGE",), # Input image from another node
|
||||||
"mask": ("MASK",), # Binary mask input
|
"mask": ("MASK",), # Binary mask input
|
||||||
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}) # API Key input with a default value
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}) # API Key input with a default value
|
||||||
|
},
|
||||||
|
"optional": {
|
||||||
|
"visual_input_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"visual_output_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,9 +21,9 @@ class EraserNode():
|
|||||||
FUNCTION = "execute" # This is the method that will be executed
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.api_url = "https://engine.prod.bria-api.com/v1/eraser" # Eraser API URL
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/edit/erase" # Eraser API URL
|
||||||
|
|
||||||
# Define the execute method as expected by ComfyUI
|
# Define the execute method as expected by ComfyUI
|
||||||
def execute(self, image, mask, api_key):
|
def execute(self, image, mask, api_key, visual_input_content_moderation, visual_output_content_moderation):
|
||||||
return process_request(self.api_url, image, mask, api_key)
|
return process_request(self.api_url, image, mask, api_key, visual_input_content_moderation, visual_output_content_moderation)
|
||||||
|
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
import requests
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import (
|
||||||
|
deserialize_and_get_comfy_key,
|
||||||
|
postprocess_image,
|
||||||
|
preprocess_image,
|
||||||
|
image_to_base64,
|
||||||
|
poll_status_until_completed,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class _BaseGenerateImageNodeV2:
|
||||||
|
"""Base class for image generation nodes (standard & pro)."""
|
||||||
|
|
||||||
|
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": {
|
||||||
|
"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}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE", "STRING", "INT")
|
||||||
|
RETURN_NAMES = ("image", "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,
|
||||||
|
model_version,
|
||||||
|
negative_prompt,
|
||||||
|
aspect_ratio,
|
||||||
|
steps_num,
|
||||||
|
guidance_scale,
|
||||||
|
seed,
|
||||||
|
images=None,
|
||||||
|
):
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
model_version,
|
||||||
|
negative_prompt,
|
||||||
|
aspect_ratio,
|
||||||
|
steps_num,
|
||||||
|
guidance_scale,
|
||||||
|
seed,
|
||||||
|
images=None,
|
||||||
|
):
|
||||||
|
self._validate_token(api_token)
|
||||||
|
payload = self._build_payload(
|
||||||
|
prompt,
|
||||||
|
model_version,
|
||||||
|
negative_prompt,
|
||||||
|
aspect_ratio,
|
||||||
|
steps_num,
|
||||||
|
guidance_scale,
|
||||||
|
seed,
|
||||||
|
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", {})
|
||||||
|
result_image_url = result.get("image_url")
|
||||||
|
structured_prompt = result.get("structured_prompt", "")
|
||||||
|
used_seed = result.get("seed")
|
||||||
|
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
|
result_image = postprocess_image(image_response.content)
|
||||||
|
|
||||||
|
return (result_image, 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 GenerateImageNodeV2(_BaseGenerateImageNodeV2):
|
||||||
|
"""Standard Image Generation Node"""
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/generate"
|
||||||
@@ -4,7 +4,7 @@ from PIL import Image
|
|||||||
import io
|
import io
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from .common import image_to_base64, preprocess_image, preprocess_mask
|
from .common import deserialize_and_get_comfy_key, preprocess_image, preprocess_mask, image_to_base64, poll_status_until_completed
|
||||||
|
|
||||||
|
|
||||||
class GenFillNode():
|
class GenFillNode():
|
||||||
@@ -17,6 +17,14 @@ class GenFillNode():
|
|||||||
"prompt": ("STRING",),
|
"prompt": ("STRING",),
|
||||||
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||||
},
|
},
|
||||||
|
"optional": {
|
||||||
|
"seed": ("INT", {"default": 123456}),
|
||||||
|
"prompt_content_moderation": ("BOOLEAN", {"default": True}),
|
||||||
|
"visual_input_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"visual_output_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
@@ -25,12 +33,13 @@ class GenFillNode():
|
|||||||
FUNCTION = "execute" # This is the method that will be executed
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.api_url = "https://engine.prod.bria-api.com/v1/gen_fill" # Eraser API URL
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/edit/gen_fill"
|
||||||
|
|
||||||
# Define the execute method as expected by ComfyUI
|
# Define the execute method as expected by ComfyUI
|
||||||
def execute(self, image, mask, prompt, api_key):
|
def execute(self, image, mask, prompt, api_key, seed, prompt_content_moderation, visual_input_content_moderation, visual_output_content_moderation):
|
||||||
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
raise Exception("Please insert a valid API key.")
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
|
||||||
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
||||||
if isinstance(image, torch.Tensor):
|
if isinstance(image, torch.Tensor):
|
||||||
@@ -44,11 +53,14 @@ class GenFillNode():
|
|||||||
|
|
||||||
# Prepare the API request payload
|
# Prepare the API request payload
|
||||||
payload = {
|
payload = {
|
||||||
"file": f"{image_base64}",
|
"image": image_base64,
|
||||||
"mask_file": f"{mask_base64}",
|
"mask": mask_base64,
|
||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
"negative_prompt": "blurry",
|
"negative_prompt": "blurry",
|
||||||
"sync": True
|
"seed": seed,
|
||||||
|
"prompt_content_moderation":prompt_content_moderation,
|
||||||
|
"visual_input_content_moderation":visual_input_content_moderation,
|
||||||
|
"visual_output_content_moderation":visual_output_content_moderation
|
||||||
}
|
}
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
@@ -57,20 +69,30 @@ class GenFillNode():
|
|||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Send initial request to get status URL
|
||||||
response = requests.post(self.api_url, json=payload, headers=headers)
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
# Check for successful response
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
print('response is 200')
|
print('Initial genfill request successful, polling for completion...')
|
||||||
# Process the output image from API response
|
|
||||||
response_dict = response.json()
|
response_dict = response.json()
|
||||||
image_response = requests.get(response_dict['urls'][0])
|
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_key)
|
||||||
|
result_image_url = final_response['result']['image_url']
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
result_image = Image.open(io.BytesIO(image_response.content))
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
result_image = result_image.convert("RGB")
|
result_image = result_image.convert("RGB")
|
||||||
result_image = np.array(result_image).astype(np.float32) / 255.0
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
result_image = torch.from_numpy(result_image)[None,]
|
result_image = torch.from_numpy(result_image)[None,]
|
||||||
return (result_image,)
|
return (result_image,)
|
||||||
else:
|
else:
|
||||||
raise Exception(f"Error: API request failed with status code {response.status_code}")
|
raise Exception(f"Error: API request failed with status code {response.status_code} {response.text}")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(f"{e}")
|
raise Exception(f"{e}")
|
||||||
|
|||||||
@@ -0,0 +1,136 @@
|
|||||||
|
import numpy as np
|
||||||
|
import requests
|
||||||
|
from PIL import Image
|
||||||
|
import io
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import deserialize_and_get_comfy_key, image_to_base64, preprocess_image, poll_status_until_completed
|
||||||
|
|
||||||
|
|
||||||
|
class ImageExpansionNode():
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"image": ("IMAGE",), # Input image from another node
|
||||||
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||||
|
},
|
||||||
|
|
||||||
|
"optional": {
|
||||||
|
"original_image_size": ("STRING",),
|
||||||
|
"original_image_location": ("STRING",),
|
||||||
|
"canvas_size": ("STRING", {"default": "1000, 1000"}),
|
||||||
|
"aspect_ratio": (["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9","None"], {"default": "None"}),
|
||||||
|
"prompt": ("STRING", {"default": ""}),
|
||||||
|
"seed": ("INT", {"default": 681794}),
|
||||||
|
"negative_prompt": ("STRING", {"default": "Ugly, mutated"}),
|
||||||
|
"prompt_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"preserve_alpha": ("BOOLEAN", {"default": True}),
|
||||||
|
"visual_input_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"visual_output_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/edit/expand" # Image Expansion API URL
|
||||||
|
|
||||||
|
# Define the execute method as expected by ComfyUI
|
||||||
|
def execute(self, image,
|
||||||
|
original_image_size,
|
||||||
|
original_image_location,
|
||||||
|
canvas_size,
|
||||||
|
aspect_ratio,
|
||||||
|
prompt,
|
||||||
|
seed,
|
||||||
|
negative_prompt,
|
||||||
|
prompt_content_moderation,
|
||||||
|
preserve_alpha,
|
||||||
|
visual_input_content_moderation,
|
||||||
|
visual_output_content_moderation,
|
||||||
|
api_key):
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
original_image_size = [int(x.strip()) for x in original_image_size.split(",")] if original_image_size else ()
|
||||||
|
original_image_location = [int(x.strip()) for x in original_image_location.split(",")] if original_image_location else ()
|
||||||
|
canvas_size = [int(x.strip()) for x in canvas_size.split(",")] if canvas_size else ()
|
||||||
|
|
||||||
|
if negative_prompt == "":
|
||||||
|
negative_prompt = " " # hack to avoid error in triton which expects non-empty string
|
||||||
|
|
||||||
|
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
# Convert the image directly to Base64 string
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
if aspect_ratio and aspect_ratio != "None":
|
||||||
|
payload = {
|
||||||
|
"image": image_base64,
|
||||||
|
"aspect_ratio": aspect_ratio,
|
||||||
|
"prompt": prompt,
|
||||||
|
"negative_prompt": negative_prompt,
|
||||||
|
"seed": seed,
|
||||||
|
"prompt_content_moderation": prompt_content_moderation,
|
||||||
|
"preserve_alpha": preserve_alpha,
|
||||||
|
"visual_input_content_moderation": visual_input_content_moderation,
|
||||||
|
"visual_output_content_moderation": visual_output_content_moderation
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
payload = {
|
||||||
|
"image": image_base64,
|
||||||
|
"original_image_size": original_image_size,
|
||||||
|
"original_image_location": original_image_location,
|
||||||
|
"canvas_size": canvas_size,
|
||||||
|
"prompt": prompt,
|
||||||
|
"negative_prompt": negative_prompt,
|
||||||
|
"seed": seed,
|
||||||
|
"prompt_content_moderation": prompt_content_moderation,
|
||||||
|
"preserve_alpha": preserve_alpha,
|
||||||
|
"visual_input_content_moderation": visual_input_content_moderation,
|
||||||
|
"visual_output_content_moderation": visual_output_content_moderation
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"api_token": f"{api_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
|
print('Initial image expansion request successful, 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}")
|
||||||
|
|
||||||
|
# Poll status URL until completion
|
||||||
|
final_response = poll_status_until_completed(status_url, api_key)
|
||||||
|
|
||||||
|
# Get the result image URL
|
||||||
|
result_image_url = final_response['result']['image_url']
|
||||||
|
|
||||||
|
# Download and process the result image
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
|
result_image = result_image.convert("RGB")
|
||||||
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
|
result_image = torch.from_numpy(result_image)[None,]
|
||||||
|
|
||||||
|
return (result_image,)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Error: API request failed with status code {response.status_code}: {response.text}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
import requests
|
||||||
|
from .common import deserialize_and_get_comfy_key, poll_status_until_completed, postprocess_image
|
||||||
|
|
||||||
|
|
||||||
|
class _BaseRefineImageNodeV2:
|
||||||
|
"""Base class for refine image nodes (standard & pro)."""
|
||||||
|
|
||||||
|
api_url = None # Must be overridden by subclasses
|
||||||
|
generate_api_url = None
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(cls):
|
||||||
|
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}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE", "STRING", "INT")
|
||||||
|
RETURN_NAMES = ("image", "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,
|
||||||
|
structured_prompt,
|
||||||
|
model_version,
|
||||||
|
negative_prompt,
|
||||||
|
aspect_ratio,
|
||||||
|
steps_num,
|
||||||
|
guidance_scale,
|
||||||
|
seed,
|
||||||
|
):
|
||||||
|
return {
|
||||||
|
"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,
|
||||||
|
}
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
api_token,
|
||||||
|
prompt,
|
||||||
|
structured_prompt,
|
||||||
|
model_version,
|
||||||
|
negative_prompt,
|
||||||
|
aspect_ratio,
|
||||||
|
steps_num,
|
||||||
|
guidance_scale,
|
||||||
|
seed,
|
||||||
|
):
|
||||||
|
self._validate_token(api_token)
|
||||||
|
payload = self._build_payload(
|
||||||
|
prompt,
|
||||||
|
structured_prompt,
|
||||||
|
model_version,
|
||||||
|
negative_prompt,
|
||||||
|
aspect_ratio,
|
||||||
|
steps_num,
|
||||||
|
guidance_scale,
|
||||||
|
seed,
|
||||||
|
)
|
||||||
|
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 refine 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)
|
||||||
|
|
||||||
|
# Step 2 to call genearte image
|
||||||
|
payloadForImageGenetrate = {
|
||||||
|
"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,
|
||||||
|
}
|
||||||
|
headers = {"Content-Type": "application/json", "api_token": api_token}
|
||||||
|
|
||||||
|
response = requests.post(self.generate_api_url, json=payloadForImageGenetrate, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code in (200, 202):
|
||||||
|
print(
|
||||||
|
f"Initial request successful to {self.generate_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", {})
|
||||||
|
result_image_url = result.get("image_url")
|
||||||
|
structured_prompt = result.get("structured_prompt", "")
|
||||||
|
used_seed = result.get("seed")
|
||||||
|
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
|
result_image = postprocess_image(image_response.content)
|
||||||
|
|
||||||
|
return (result_image, 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 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"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .common import postprocess_image, preprocess_image, image_to_base64
|
from .common import deserialize_and_get_comfy_key, postprocess_image, preprocess_image, image_to_base64
|
||||||
|
|
||||||
|
|
||||||
class ReimagineNode():
|
class ReimagineNode():
|
||||||
@@ -20,6 +20,7 @@ class ReimagineNode():
|
|||||||
"tailored_model_id": ("STRING", ),
|
"tailored_model_id": ("STRING", ),
|
||||||
"tailored_model_influence": ("FLOAT", {"default": 0.5}),
|
"tailored_model_influence": ("FLOAT", {"default": 0.5}),
|
||||||
"tailored_generation_prefix": ("STRING",), # if used with tailored, possibly get this from the tailored model info node
|
"tailored_generation_prefix": ("STRING",), # if used with tailored, possibly get this from the tailored model info node
|
||||||
|
"content_moderation": ("INT", {"default": 0}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,8 +36,9 @@ class ReimagineNode():
|
|||||||
self, api_key, prompt, seed,
|
self, api_key, prompt, seed,
|
||||||
steps_num, fast, structure_ref_influence, structure_image=None,
|
steps_num, fast, structure_ref_influence, structure_image=None,
|
||||||
tailored_model_id=None, tailored_model_influence=None, tailored_generation_prefix=None,
|
tailored_model_id=None, tailored_model_influence=None, tailored_generation_prefix=None,
|
||||||
|
content_moderation=0,
|
||||||
):
|
):
|
||||||
fast = bool(fast)
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
payload = {
|
payload = {
|
||||||
"prompt": tailored_generation_prefix + prompt,
|
"prompt": tailored_generation_prefix + prompt,
|
||||||
"num_results": 1,
|
"num_results": 1,
|
||||||
@@ -44,6 +46,7 @@ class ReimagineNode():
|
|||||||
"seed": seed,
|
"seed": seed,
|
||||||
"steps_num": steps_num,
|
"steps_num": steps_num,
|
||||||
"include_generation_prefix": False,
|
"include_generation_prefix": False,
|
||||||
|
"content_moderation": content_moderation,
|
||||||
}
|
}
|
||||||
if structure_image is not None:
|
if structure_image is not None:
|
||||||
structure_image = preprocess_image(structure_image)
|
structure_image = preprocess_image(structure_image)
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import numpy as np
|
||||||
|
import requests
|
||||||
|
from PIL import Image
|
||||||
|
import io
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import deserialize_and_get_comfy_key, preprocess_image, image_to_base64, poll_status_until_completed
|
||||||
|
|
||||||
|
|
||||||
|
class RemoveForegroundNode():
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"image": ("IMAGE",), # Input image from another node
|
||||||
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||||
|
},
|
||||||
|
"optional": {
|
||||||
|
"visual_input_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"visual_output_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"preserve_alpha": ("BOOLEAN", {"default": True}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/edit/erase_foreground" # remove foreground API URL
|
||||||
|
|
||||||
|
# Define the execute method as expected by ComfyUI
|
||||||
|
def execute(self, image, visual_input_content_moderation, visual_output_content_moderation, preserve_alpha, api_key):
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
|
||||||
|
# Check if image is tensor, if so, convert to NumPy array
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
# Prepare the API request payload
|
||||||
|
# temporary save the image to /tmp
|
||||||
|
# temp_img_path = "/tmp/temp_img.jpeg"
|
||||||
|
# image.save(temp_img_path, format="JPEG")
|
||||||
|
|
||||||
|
# files=[('file',('temp_img.jpeg', open(temp_img_path, 'rb'),'image/jpeg'))
|
||||||
|
# ]
|
||||||
|
payload = {
|
||||||
|
"image": image_to_base64(image),
|
||||||
|
"visual_input_content_moderation": visual_input_content_moderation,
|
||||||
|
"visual_output_content_moderation":visual_output_content_moderation,
|
||||||
|
"preserve_alpha": preserve_alpha
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"api_token": f"{api_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
|
print('Initial request successful, 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}")
|
||||||
|
|
||||||
|
# Poll status URL until completion
|
||||||
|
final_response = poll_status_until_completed(status_url, api_key)
|
||||||
|
|
||||||
|
# Get the result image URL
|
||||||
|
result_image_url = final_response['result']['image_url']
|
||||||
|
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
|
result_image = torch.from_numpy(result_image)[None,]
|
||||||
|
return (result_image,)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Error: API request failed with status code {response.status_code} {response.text}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
import numpy as np
|
||||||
|
import requests
|
||||||
|
from PIL import Image
|
||||||
|
import io
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import deserialize_and_get_comfy_key, image_to_base64, preprocess_image, preprocess_mask, poll_status_until_completed
|
||||||
|
|
||||||
|
|
||||||
|
class ReplaceBgNode():
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"image": ("IMAGE",), # Input image from another node
|
||||||
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||||
|
},
|
||||||
|
"optional": {
|
||||||
|
"mode": (["base", "fast", "high_control"], {"default": "base"}),
|
||||||
|
"prompt": ("STRING",),
|
||||||
|
"ref_images": ("IMAGE",),
|
||||||
|
"refine_prompt": ("BOOLEAN", {"default": True}),
|
||||||
|
"enhance_ref_images": ("BOOLEAN", {"default": True}),
|
||||||
|
"original_quality": ("BOOLEAN", {"default": False}),
|
||||||
|
"negative_prompt": ("STRING", {"default": None}),
|
||||||
|
"seed": ("INT", {"default": 681794}),
|
||||||
|
"visual_output_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"prompt_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"force_background_detection": ("BOOLEAN", {"default": False}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/edit/replace_background" # Replace BG API URL
|
||||||
|
|
||||||
|
# Define the execute method as expected by ComfyUI
|
||||||
|
def execute(self, image, mode,
|
||||||
|
refine_prompt,
|
||||||
|
original_quality,
|
||||||
|
negative_prompt,
|
||||||
|
seed,
|
||||||
|
api_key,
|
||||||
|
visual_output_content_moderation,
|
||||||
|
prompt_content_moderation,
|
||||||
|
enhance_ref_images,
|
||||||
|
force_background_detection,
|
||||||
|
prompt=None,
|
||||||
|
ref_images=None,):
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
|
||||||
|
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
# Convert the image to Base64 string
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
|
||||||
|
if ref_images is not None:
|
||||||
|
ref_images = preprocess_image(ref_images)
|
||||||
|
ref_images = [image_to_base64(ref_images)]
|
||||||
|
else:
|
||||||
|
ref_images=[]
|
||||||
|
|
||||||
|
# Prepare the API request payload for v2 API
|
||||||
|
payload = {
|
||||||
|
"image": image_base64,
|
||||||
|
"mode": mode,
|
||||||
|
"prompt": prompt,
|
||||||
|
"ref_images":ref_images,
|
||||||
|
"refine_prompt": refine_prompt,
|
||||||
|
"original_quality": original_quality,
|
||||||
|
"negative_prompt": negative_prompt,
|
||||||
|
"seed": seed,
|
||||||
|
"prompt_content_moderation": prompt_content_moderation,
|
||||||
|
"visual_output_content_moderation":visual_output_content_moderation,
|
||||||
|
"enhance_ref_images":enhance_ref_images,
|
||||||
|
"force_background_detection": force_background_detection
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"api_token": f"{api_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
|
print('Initial replace background request successful, 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}")
|
||||||
|
|
||||||
|
# Poll status URL until completion
|
||||||
|
final_response = poll_status_until_completed(status_url, api_key)
|
||||||
|
|
||||||
|
# Get the result image URL
|
||||||
|
result_image_url = final_response['result']['image_url']
|
||||||
|
|
||||||
|
# Download and process the result image
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
|
result_image = result_image.convert("RGB")
|
||||||
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
|
result_image = torch.from_numpy(result_image)[None,]
|
||||||
|
|
||||||
|
return (result_image,)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Error: API request failed with status code {response.status_code}{response.text}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
import numpy as np
|
||||||
|
import requests
|
||||||
|
from PIL import Image
|
||||||
|
import io
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import deserialize_and_get_comfy_key, preprocess_image, image_to_base64, poll_status_until_completed
|
||||||
|
|
||||||
|
class RmbgNode():
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"image": ("IMAGE",), # Input image from another node
|
||||||
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||||
|
},
|
||||||
|
"optional": {
|
||||||
|
"visual_input_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"visual_output_content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
"preserve_alpha": ("BOOLEAN", {"default": True}),
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v2/image/edit/remove_background" # RMBG API URL
|
||||||
|
|
||||||
|
# Define the execute method as expected by ComfyUI
|
||||||
|
def execute(self, image, visual_input_content_moderation, visual_output_content_moderation, preserve_alpha, api_key):
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
# Check if image is tensor, if so, convert to NumPy array
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
# Convert image to base64 for the new API format
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
payload = {
|
||||||
|
"image": image_base64,
|
||||||
|
"visual_input_content_moderation": visual_input_content_moderation,
|
||||||
|
"visual_output_content_moderation":visual_output_content_moderation,
|
||||||
|
"preserve_alpha":preserve_alpha
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"api_token": f"{api_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200 or response.status_code == 202:
|
||||||
|
print('Initial RMBG request successful, 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_key)
|
||||||
|
|
||||||
|
# Get the result image URL
|
||||||
|
result_image_url = final_response['result']['image_url']
|
||||||
|
|
||||||
|
# Download and process the result image
|
||||||
|
image_response = requests.get(result_image_url)
|
||||||
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
|
result_image = torch.from_numpy(result_image)[None,]
|
||||||
|
|
||||||
|
return (result_image,)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Error: API request failed with status code {response.status_code} {response.text}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
from .utils.shot_utils import get_image_input_types, create_image_payload, make_api_request, shot_by_image_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByImageAutomaticAspectRatioNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_image_input_types()
|
||||||
|
input_types["required"]["aspect_ratio"] = (
|
||||||
|
["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"],
|
||||||
|
{"default": "1:1"},
|
||||||
|
)
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_image_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
aspect_ratio,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
enhance_ref_image=True,
|
||||||
|
ref_image_influence=1.0,
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_image_payload(
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
api_key,
|
||||||
|
PlacementType.AUTOMATIC_ASPECT_RATIO.value,
|
||||||
|
aspect_ratio=aspect_ratio,
|
||||||
|
sync=sync,
|
||||||
|
enhance_ref_image=enhance_ref_image,
|
||||||
|
ref_image_influence=ref_image_influence,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
from .utils.shot_utils import get_image_input_types, create_image_payload, make_api_request, shot_by_image_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByImageAutomaticNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_image_input_types()
|
||||||
|
input_types["required"]["shot_size"] = ("STRING", {"default": "1000, 1000"})
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE")
|
||||||
|
RETURN_NAMES = (
|
||||||
|
"output_image_1",
|
||||||
|
"output_image_2",
|
||||||
|
"output_image_3",
|
||||||
|
"output_image_4",
|
||||||
|
"output_image_5",
|
||||||
|
"output_image_6",
|
||||||
|
"output_image_7",
|
||||||
|
)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_image_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
shot_size,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
enhance_ref_image=True,
|
||||||
|
ref_image_influence=1.0,
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_image_payload(
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
api_key,
|
||||||
|
PlacementType.AUTOMATIC.value,
|
||||||
|
shot_size=shot_size,
|
||||||
|
sync=sync,
|
||||||
|
enhance_ref_image=enhance_ref_image,
|
||||||
|
ref_image_influence=ref_image_influence,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key, Placement_type = PlacementType.AUTOMATIC.value)
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
from .utils.shot_utils import get_image_input_types, create_image_payload, make_api_request, shot_by_image_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByImageCustomCoordinatesNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_image_input_types()
|
||||||
|
input_types["required"]["shot_size"] = ("STRING", {"default": "1000, 1000"})
|
||||||
|
input_types["required"]["foreground_image_size"] = (
|
||||||
|
"STRING",
|
||||||
|
{"default": "500,500"},
|
||||||
|
)
|
||||||
|
input_types["required"]["foreground_image_location"] = (
|
||||||
|
"STRING",
|
||||||
|
{"default": "0, 0"},
|
||||||
|
)
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_image_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
shot_size,
|
||||||
|
foreground_image_size,
|
||||||
|
foreground_image_location,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
enhance_ref_image=True,
|
||||||
|
ref_image_influence=1.0,
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_image_payload(
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
api_key,
|
||||||
|
PlacementType.CUSTOM_COORDINATES.value,
|
||||||
|
shot_size=shot_size,
|
||||||
|
foreground_image_size=foreground_image_size,
|
||||||
|
foreground_image_location=foreground_image_location,
|
||||||
|
sync=sync,
|
||||||
|
enhance_ref_image=enhance_ref_image,
|
||||||
|
ref_image_influence=ref_image_influence,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
from .utils.shot_utils import get_image_input_types, create_image_payload, make_api_request, shot_by_image_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByImageManualPaddingNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_image_input_types()
|
||||||
|
input_types["required"]["padding_values"] = ("STRING", {"default": "0,0,0,0"})
|
||||||
|
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_image_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
padding_values,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
enhance_ref_image=True,
|
||||||
|
ref_image_influence=1.0,
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_image_payload(
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
api_key,
|
||||||
|
PlacementType.MANUAL_PADDING.value,
|
||||||
|
padding_values=padding_values,
|
||||||
|
sync=sync,
|
||||||
|
enhance_ref_image=enhance_ref_image,
|
||||||
|
ref_image_influence=ref_image_influence,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
from .utils.shot_utils import get_image_input_types, create_image_payload, make_api_request, shot_by_image_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByImageManualPlacementNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_image_input_types()
|
||||||
|
input_types["required"]["shot_size"] = ("STRING", {"default": "1000, 1000"})
|
||||||
|
input_types["required"]["manual_placement_selection"] = (
|
||||||
|
[
|
||||||
|
"upper_left",
|
||||||
|
"upper_right",
|
||||||
|
"bottom_left",
|
||||||
|
"bottom_right",
|
||||||
|
"right_center",
|
||||||
|
"left_center",
|
||||||
|
"upper_center",
|
||||||
|
"bottom_center",
|
||||||
|
"center_vertical",
|
||||||
|
"center_horizontal",
|
||||||
|
],
|
||||||
|
{"default": "upper_left"},
|
||||||
|
)
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_image_api_url
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
shot_size,
|
||||||
|
manual_placement_selection,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
enhance_ref_image=True,
|
||||||
|
ref_image_influence=1.0,
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_image_payload(
|
||||||
|
image,
|
||||||
|
ref_image,
|
||||||
|
api_key,
|
||||||
|
PlacementType.MANUAL_PLACEMENT.value,
|
||||||
|
shot_size=shot_size,
|
||||||
|
manual_placement_selection=manual_placement_selection,
|
||||||
|
sync=sync,
|
||||||
|
enhance_ref_image=enhance_ref_image,
|
||||||
|
ref_image_influence=ref_image_influence,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
+30
-57
@@ -1,68 +1,41 @@
|
|||||||
import requests
|
from .utils.shot_utils import get_image_input_types, create_image_payload, make_api_request, shot_by_image_api_url, PlacementType
|
||||||
import torch
|
|
||||||
|
|
||||||
from .common import postprocess_image, preprocess_image, image_to_base64
|
|
||||||
|
|
||||||
class ShotByImageNode():
|
class ShotByImageOriginalNode:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(self):
|
def INPUT_TYPES(self):
|
||||||
return {
|
input_types = get_image_input_types()
|
||||||
"required": {
|
return input_types
|
||||||
"image": ("IMAGE",), # Input image from another node
|
|
||||||
"ref_image": ("IMAGE",), # ref image from another node
|
|
||||||
"enhance_ref_image": ("INT", {"default": 1}),
|
|
||||||
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}) # API Key input with a default value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
RETURN_NAMES = ("output_image",)
|
RETURN_NAMES = ("output_image",)
|
||||||
CATEGORY = "API Nodes"
|
CATEGORY = "API Nodes"
|
||||||
FUNCTION = "execute" # This is the method that will be executed
|
FUNCTION = "execute"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.api_url = "https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_image" # Eraser API URL
|
self.api_url = shot_by_image_api_url
|
||||||
|
|
||||||
# Define the execute method as expected by ComfyUI
|
def execute(
|
||||||
def execute(self, image, ref_image, api_key, enhance_ref_image, ):
|
self,
|
||||||
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
image,
|
||||||
raise Exception("Please insert a valid API key.")
|
ref_image,
|
||||||
|
api_key,
|
||||||
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
sync=True,
|
||||||
if isinstance(image, torch.Tensor):
|
enhance_ref_image=True,
|
||||||
image = preprocess_image(image)
|
ref_image_influence=1.0,
|
||||||
if isinstance(ref_image, torch.Tensor):
|
force_rmbg=False,
|
||||||
ref_image = preprocess_image(ref_image)
|
content_moderation=False,
|
||||||
|
):
|
||||||
# Convert the image and mask directly to Base64 strings
|
payload = create_image_payload(
|
||||||
image_base64 = image_to_base64(image)
|
image,
|
||||||
ref_image_base64 = image_to_base64(ref_image)
|
ref_image,
|
||||||
enhance_ref_image = bool(enhance_ref_image)
|
api_key,
|
||||||
|
PlacementType.ORIGINAL.value,
|
||||||
payload = {
|
original_quality=True,
|
||||||
"file": image_base64,
|
sync=sync,
|
||||||
"ref_image_file": ref_image_base64,
|
enhance_ref_image=enhance_ref_image,
|
||||||
"enhance_ref_image": enhance_ref_image,
|
ref_image_influence=ref_image_influence,
|
||||||
"placement_type": "original",
|
force_rmbg=force_rmbg,
|
||||||
"original_quality": True,
|
content_moderation=content_moderation,
|
||||||
"sync": True
|
)
|
||||||
}
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
headers = {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"api_token": f"{api_key}"
|
|
||||||
}
|
|
||||||
try:
|
|
||||||
response = requests.post(self.api_url, json=payload, headers=headers)
|
|
||||||
# Check for successful response
|
|
||||||
if response.status_code == 200:
|
|
||||||
print('response is 200')
|
|
||||||
# Process the output image from API response
|
|
||||||
response_dict = response.json()
|
|
||||||
image_response = requests.get(response_dict['result'][0][0])
|
|
||||||
result_image = postprocess_image(image_response.content)
|
|
||||||
return (result_image,)
|
|
||||||
else:
|
|
||||||
raise Exception(f"Error: API request failed with status code {response.status_code}")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
raise Exception(f"{e}")
|
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
from .utils.shot_utils import get_text_input_types, create_text_payload, make_api_request, shot_by_text_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByTextAutomaticAspectRatioNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_text_input_types()
|
||||||
|
input_types["required"]["aspect_ratio"] = (
|
||||||
|
["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9"],
|
||||||
|
{"default": "1:1"},
|
||||||
|
)
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_text_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
aspect_ratio,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
optimize_description=True,
|
||||||
|
exclude_elements="",
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_text_payload(
|
||||||
|
image,
|
||||||
|
api_key,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
PlacementType.AUTOMATIC_ASPECT_RATIO.value,
|
||||||
|
aspect_ratio=aspect_ratio,
|
||||||
|
sync=sync,
|
||||||
|
optimize_description=optimize_description,
|
||||||
|
exclude_elements=exclude_elements,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
from .utils.shot_utils import get_text_input_types, create_text_payload, make_api_request, shot_by_text_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByTextAutomaticNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_text_input_types()
|
||||||
|
input_types["required"]["shot_size"] = ("STRING", {"default": "1000, 1000"})
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE", "IMAGE")
|
||||||
|
RETURN_NAMES = (
|
||||||
|
"output_image_1",
|
||||||
|
"output_image_2",
|
||||||
|
"output_image_3",
|
||||||
|
"output_image_4",
|
||||||
|
"output_image_5",
|
||||||
|
"output_image_6",
|
||||||
|
"output_image_7",
|
||||||
|
)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_text_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
shot_size,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
optimize_description=True,
|
||||||
|
exclude_elements="",
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_text_payload(
|
||||||
|
image,
|
||||||
|
api_key,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
PlacementType.AUTOMATIC.value,
|
||||||
|
shot_size=shot_size,
|
||||||
|
sync=sync,
|
||||||
|
optimize_description=optimize_description,
|
||||||
|
exclude_elements=exclude_elements,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key, Placement_type= PlacementType.AUTOMATIC.value)
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
from .utils.shot_utils import get_text_input_types, create_text_payload, make_api_request, shot_by_text_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByTextCustomCoordinatesNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_text_input_types()
|
||||||
|
input_types["required"]["shot_size"] = ("STRING", {"default": "1000, 1000"})
|
||||||
|
input_types["required"]["foreground_image_size"] = (
|
||||||
|
"STRING",
|
||||||
|
{"default": "500,500"},
|
||||||
|
)
|
||||||
|
input_types["required"]["foreground_image_location"] = (
|
||||||
|
"STRING",
|
||||||
|
{"default": "0, 0"},
|
||||||
|
)
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_text_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
shot_size,
|
||||||
|
foreground_image_size,
|
||||||
|
foreground_image_location,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
optimize_description=True,
|
||||||
|
exclude_elements="",
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_text_payload(
|
||||||
|
image,
|
||||||
|
api_key,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
PlacementType.CUSTOM_COORDINATES.value,
|
||||||
|
shot_size=shot_size,
|
||||||
|
foreground_image_size=foreground_image_size,
|
||||||
|
foreground_image_location=foreground_image_location,
|
||||||
|
sync=sync,
|
||||||
|
optimize_description=optimize_description,
|
||||||
|
exclude_elements=exclude_elements,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
from .utils.shot_utils import get_text_input_types, create_text_payload, make_api_request, shot_by_text_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByTextManualPaddingNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_text_input_types()
|
||||||
|
input_types["required"]["padding_values"] = ("STRING", {"default": "0,0,0,0"})
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_text_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
padding_values,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
optimize_description=True,
|
||||||
|
exclude_elements="",
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_text_payload(
|
||||||
|
image,
|
||||||
|
api_key,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
PlacementType.MANUAL_PADDING.value,
|
||||||
|
padding_values=padding_values,
|
||||||
|
sync=sync,
|
||||||
|
optimize_description=optimize_description,
|
||||||
|
exclude_elements=exclude_elements,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
from .utils.shot_utils import get_text_input_types, create_text_payload, make_api_request, shot_by_text_api_url, PlacementType
|
||||||
|
|
||||||
|
|
||||||
|
class ShotByTextManualPlacementNode:
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
input_types = get_text_input_types()
|
||||||
|
input_types["required"]["shot_size"] = ("STRING", {"default": "1000, 1000"})
|
||||||
|
input_types["required"]["manual_placement_selection"] = (
|
||||||
|
[
|
||||||
|
"upper_left",
|
||||||
|
"upper_right",
|
||||||
|
"bottom_left",
|
||||||
|
"bottom_right",
|
||||||
|
"right_center",
|
||||||
|
"left_center",
|
||||||
|
"upper_center",
|
||||||
|
"bottom_center",
|
||||||
|
"center_vertical",
|
||||||
|
"center_horizontal",
|
||||||
|
],
|
||||||
|
{"default": "upper_left"},
|
||||||
|
)
|
||||||
|
return input_types
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute"
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = shot_by_text_api_url
|
||||||
|
|
||||||
|
def execute(
|
||||||
|
self,
|
||||||
|
image,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
shot_size,
|
||||||
|
manual_placement_selection,
|
||||||
|
api_key,
|
||||||
|
sync=False,
|
||||||
|
optimize_description=True,
|
||||||
|
exclude_elements="",
|
||||||
|
force_rmbg=False,
|
||||||
|
content_moderation=False,
|
||||||
|
):
|
||||||
|
payload = create_text_payload(
|
||||||
|
image,
|
||||||
|
api_key,
|
||||||
|
scene_description,
|
||||||
|
mode,
|
||||||
|
PlacementType.MANUAL_PLACEMENT.value,
|
||||||
|
shot_size=shot_size,
|
||||||
|
manual_placement_selection=manual_placement_selection,
|
||||||
|
sync=sync,
|
||||||
|
optimize_description=optimize_description,
|
||||||
|
exclude_elements=exclude_elements,
|
||||||
|
force_rmbg=force_rmbg,
|
||||||
|
content_moderation=content_moderation,
|
||||||
|
)
|
||||||
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
+32
-54
@@ -1,64 +1,42 @@
|
|||||||
import requests
|
from .utils.shot_utils import get_text_input_types, create_text_payload, make_api_request, shot_by_text_api_url, PlacementType
|
||||||
import torch
|
|
||||||
|
|
||||||
from .common import postprocess_image, preprocess_image, image_to_base64
|
|
||||||
|
|
||||||
class ShotByTextNode():
|
class ShotByTextOriginalNode:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(self):
|
def INPUT_TYPES(self):
|
||||||
return {
|
input_types = get_text_input_types()
|
||||||
"required": {
|
return input_types
|
||||||
"image": ("IMAGE",), # Input image from another node
|
|
||||||
"scene_description": ("STRING",),
|
|
||||||
"optimize_description": ("INT", {"default": 1}),
|
|
||||||
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}) # API Key input with a default value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE",)
|
RETURN_TYPES = ("IMAGE",)
|
||||||
RETURN_NAMES = ("output_image",)
|
RETURN_NAMES = ("output_image",)
|
||||||
CATEGORY = "API Nodes"
|
CATEGORY = "API Nodes"
|
||||||
FUNCTION = "execute" # This is the method that will be executed
|
FUNCTION = "execute"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.api_url = "https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_text" # Eraser API URL
|
self.api_url = shot_by_text_api_url
|
||||||
|
def execute(
|
||||||
# Define the execute method as expected by ComfyUI
|
self,
|
||||||
def execute(self, image, api_key, scene_description, optimize_description, ):
|
image,
|
||||||
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
scene_description,
|
||||||
raise Exception("Please insert a valid API key.")
|
mode,
|
||||||
|
api_key,
|
||||||
# Check if image and mask are tensors, if so, convert to NumPy arrays
|
sync=True,
|
||||||
if isinstance(image, torch.Tensor):
|
optimize_description=True,
|
||||||
image = preprocess_image(image)
|
exclude_elements="",
|
||||||
|
force_rmbg=False,
|
||||||
optimize_description = bool(optimize_description)
|
content_moderation=False,
|
||||||
image_base64 = image_to_base64(image)
|
):
|
||||||
payload = {
|
payload = create_text_payload(
|
||||||
"file": image_base64,
|
image,
|
||||||
"scene_description": scene_description,
|
api_key,
|
||||||
"optimize_description": optimize_description,
|
scene_description,
|
||||||
"placement_type": "original",
|
mode,
|
||||||
"original_quality": True,
|
PlacementType.ORIGINAL.value,
|
||||||
"sync": True
|
original_quality=True,
|
||||||
}
|
sync=sync,
|
||||||
headers = {
|
optimize_description=optimize_description,
|
||||||
"Content-Type": "application/json",
|
exclude_elements=exclude_elements,
|
||||||
"api_token": f"{api_key}"
|
force_rmbg=force_rmbg,
|
||||||
}
|
content_moderation=content_moderation,
|
||||||
try:
|
)
|
||||||
response = requests.post(self.api_url, json=payload, headers=headers)
|
return make_api_request(self.api_url, payload, api_key)
|
||||||
# Check for successful response
|
|
||||||
if response.status_code == 200:
|
|
||||||
print('response is 200')
|
|
||||||
# Process the output image from API response
|
|
||||||
response_dict = response.json()
|
|
||||||
image_response = requests.get(response_dict['result'][0][0])
|
|
||||||
result_image = postprocess_image(image_response.content)
|
|
||||||
return (result_image,)
|
|
||||||
else:
|
|
||||||
raise Exception(f"Error: API request failed with status code {response.status_code}")
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
raise Exception(f"{e}")
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .common import postprocess_image, preprocess_image, image_to_base64
|
from .common import deserialize_and_get_comfy_key, postprocess_image, preprocess_image, image_to_base64
|
||||||
|
|
||||||
|
|
||||||
class TailoredGenNode():
|
class TailoredGenNode():
|
||||||
@@ -26,6 +26,7 @@ class TailoredGenNode():
|
|||||||
"guidance_method_2": (["controlnet_canny", "controlnet_depth", "controlnet_recoloring", "controlnet_color_grid"], {"default": "controlnet_canny"}),
|
"guidance_method_2": (["controlnet_canny", "controlnet_depth", "controlnet_recoloring", "controlnet_color_grid"], {"default": "controlnet_canny"}),
|
||||||
"guidance_method_2_scale": ("FLOAT", {"default": 1.0}),
|
"guidance_method_2_scale": ("FLOAT", {"default": 1.0}),
|
||||||
"guidance_method_2_image": ("IMAGE", ),
|
"guidance_method_2_image": ("IMAGE", ),
|
||||||
|
"content_moderation": ("INT", {"default": 0}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,8 +43,9 @@ class TailoredGenNode():
|
|||||||
seed, model_influence, negative_prompt, fast, steps_num,
|
seed, model_influence, negative_prompt, fast, steps_num,
|
||||||
guidance_method_1=None, guidance_method_1_scale=None, guidance_method_1_image=None,
|
guidance_method_1=None, guidance_method_1_scale=None, guidance_method_1_image=None,
|
||||||
guidance_method_2=None, guidance_method_2_scale=None, guidance_method_2_image=None,
|
guidance_method_2=None, guidance_method_2_scale=None, guidance_method_2_image=None,
|
||||||
|
content_moderation=0,
|
||||||
):
|
):
|
||||||
fast = bool(fast)
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
payload = {
|
payload = {
|
||||||
"prompt": generation_prefix + prompt,
|
"prompt": generation_prefix + prompt,
|
||||||
"num_results": 1,
|
"num_results": 1,
|
||||||
@@ -55,6 +57,7 @@ class TailoredGenNode():
|
|||||||
"fast": fast,
|
"fast": fast,
|
||||||
"steps_num": steps_num,
|
"steps_num": steps_num,
|
||||||
"include_generation_prefix": False,
|
"include_generation_prefix": False,
|
||||||
|
"content_moderation": content_moderation,
|
||||||
}
|
}
|
||||||
if guidance_method_1_image is not None:
|
if guidance_method_1_image is not None:
|
||||||
guidance_method_1_image = preprocess_image(guidance_method_1_image)
|
guidance_method_1_image = preprocess_image(guidance_method_1_image)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import requests
|
import requests
|
||||||
|
from .common import deserialize_and_get_comfy_key
|
||||||
|
|
||||||
class TailoredModelInfoNode():
|
class TailoredModelInfoNode():
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -21,6 +21,7 @@ class TailoredModelInfoNode():
|
|||||||
|
|
||||||
# Define the execute method as expected by ComfyUI
|
# Define the execute method as expected by ComfyUI
|
||||||
def execute(self, model_id, api_key):
|
def execute(self, model_id, api_key):
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
self.api_url + model_id,
|
self.api_url + model_id,
|
||||||
headers={"api_token": api_key}
|
headers={"api_token": api_key}
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
import numpy as np
|
||||||
|
import requests
|
||||||
|
from PIL import Image
|
||||||
|
import io
|
||||||
|
import torch
|
||||||
|
|
||||||
|
from .common import deserialize_and_get_comfy_key, image_to_base64, preprocess_image
|
||||||
|
|
||||||
|
class TailoredPortraitNode():
|
||||||
|
@classmethod
|
||||||
|
def INPUT_TYPES(self):
|
||||||
|
return {
|
||||||
|
"required": {
|
||||||
|
"image": ("IMAGE",), # Input image from another node
|
||||||
|
"tailored_model_id": ("STRING",), # API Key input with a default value
|
||||||
|
"api_key": ("STRING", {"default": "BRIA_API_TOKEN"}), # API Key input with a default value
|
||||||
|
},
|
||||||
|
"optional": {
|
||||||
|
"seed": ("INT", {"default": 123456}),
|
||||||
|
"tailored_model_influence": ("FLOAT", {"default": 0.9}),
|
||||||
|
"id_strength": ("FLOAT", {"default": 0.7}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RETURN_TYPES = ("IMAGE",)
|
||||||
|
RETURN_NAMES = ("output_image",)
|
||||||
|
CATEGORY = "API Nodes"
|
||||||
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.api_url = "https://engine.prod.bria-api.com/v1/tailored-gen/restyle_portrait" # Eraser API URL
|
||||||
|
|
||||||
|
# Define the execute method as expected by ComfyUI
|
||||||
|
def execute(self, image, tailored_model_id, api_key, seed, tailored_model_influence, id_strength):
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
|
||||||
|
# Convert the image and mask directly to if isinstance(image, torch.Tensor):
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
|
||||||
|
# Prepare the API request payload
|
||||||
|
payload = {
|
||||||
|
"id_image_file": f"{image_base64}",
|
||||||
|
"tailored_model_id": int(tailored_model_id),
|
||||||
|
"tailored_model_influence": tailored_model_influence,
|
||||||
|
"id_strength": id_strength,
|
||||||
|
"seed": seed
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"api_token": f"{api_key}"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = requests.post(self.api_url, json=payload, headers=headers)
|
||||||
|
# Check for successful response
|
||||||
|
if response.status_code == 200:
|
||||||
|
print('response is 200')
|
||||||
|
# Process the output image from API response
|
||||||
|
response_dict = response.json()
|
||||||
|
image_response = requests.get(response_dict['image_res'])
|
||||||
|
result_image = Image.open(io.BytesIO(image_response.content))
|
||||||
|
result_image = result_image.convert("RGB")
|
||||||
|
result_image = np.array(result_image).astype(np.float32) / 255.0
|
||||||
|
result_image = torch.from_numpy(result_image)[None,]
|
||||||
|
return (result_image,)
|
||||||
|
else:
|
||||||
|
raise Exception(f"Error: API request failed with status code {response.status_code} {response.text}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .common import postprocess_image, preprocess_image, image_to_base64
|
from .common import deserialize_and_get_comfy_key, postprocess_image, preprocess_image, image_to_base64
|
||||||
|
|
||||||
|
|
||||||
class Text2ImageBaseNode():
|
class Text2ImageBaseNode():
|
||||||
@@ -28,6 +28,7 @@ class Text2ImageBaseNode():
|
|||||||
"image_prompt_mode": (["regular", "style_only"], {"default": "regular"}),
|
"image_prompt_mode": (["regular", "style_only"], {"default": "regular"}),
|
||||||
"image_prompt_image": ("IMAGE", ),
|
"image_prompt_image": ("IMAGE", ),
|
||||||
"image_prompt_scale": ("FLOAT", {"default": 1.0}),
|
"image_prompt_scale": ("FLOAT", {"default": 1.0}),
|
||||||
|
"content_moderation": ("INT", {"default": 0}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ class Text2ImageBaseNode():
|
|||||||
FUNCTION = "execute" # This is the method that will be executed
|
FUNCTION = "execute" # This is the method that will be executed
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.api_url = "https://engine.prod.bria-api.com/v1/text-to-image/base/2.3" #"http://0.0.0.0:5000/v1/text-to-image/base/2.3"
|
self.api_url = "https://engine.prod.bria-api.com/v1/text-to-image/base/3.2"
|
||||||
|
|
||||||
def execute(
|
def execute(
|
||||||
self, api_key, prompt, aspect_ratio, seed, negative_prompt,
|
self, api_key, prompt, aspect_ratio, seed, negative_prompt,
|
||||||
@@ -45,8 +46,9 @@ class Text2ImageBaseNode():
|
|||||||
guidance_method_1=None, guidance_method_1_scale=None, guidance_method_1_image=None,
|
guidance_method_1=None, guidance_method_1_scale=None, guidance_method_1_image=None,
|
||||||
guidance_method_2=None, guidance_method_2_scale=None, guidance_method_2_image=None,
|
guidance_method_2=None, guidance_method_2_scale=None, guidance_method_2_image=None,
|
||||||
image_prompt_mode=None, image_prompt_image=None, image_prompt_scale=None,
|
image_prompt_mode=None, image_prompt_image=None, image_prompt_scale=None,
|
||||||
|
content_moderation=0,
|
||||||
):
|
):
|
||||||
prompt_enhancement = bool(prompt_enhancement)
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
payload = {
|
payload = {
|
||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
"num_results": 1,
|
"num_results": 1,
|
||||||
@@ -57,6 +59,7 @@ class Text2ImageBaseNode():
|
|||||||
"steps_num": steps_num,
|
"steps_num": steps_num,
|
||||||
"text_guidance_scale": text_guidance_scale,
|
"text_guidance_scale": text_guidance_scale,
|
||||||
"prompt_enhancement": prompt_enhancement,
|
"prompt_enhancement": prompt_enhancement,
|
||||||
|
"content_moderation": content_moderation,
|
||||||
}
|
}
|
||||||
if medium != "none":
|
if medium != "none":
|
||||||
payload["medium"] = medium
|
payload["medium"] = medium
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .common import postprocess_image, preprocess_image, image_to_base64
|
from .common import deserialize_and_get_comfy_key, postprocess_image, preprocess_image, image_to_base64
|
||||||
|
|
||||||
|
|
||||||
class Text2ImageFastNode():
|
class Text2ImageFastNode():
|
||||||
@@ -25,6 +25,7 @@ class Text2ImageFastNode():
|
|||||||
"image_prompt_mode": (["regular", "style_only"], {"default": "regular"}),
|
"image_prompt_mode": (["regular", "style_only"], {"default": "regular"}),
|
||||||
"image_prompt_image": ("IMAGE", ),
|
"image_prompt_image": ("IMAGE", ),
|
||||||
"image_prompt_scale": ("FLOAT", {"default": 1.0}),
|
"image_prompt_scale": ("FLOAT", {"default": 1.0}),
|
||||||
|
"content_moderation": ("INT", {"default": 0}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,8 +43,9 @@ class Text2ImageFastNode():
|
|||||||
guidance_method_1=None, guidance_method_1_scale=None, guidance_method_1_image=None,
|
guidance_method_1=None, guidance_method_1_scale=None, guidance_method_1_image=None,
|
||||||
guidance_method_2=None, guidance_method_2_scale=None, guidance_method_2_image=None,
|
guidance_method_2=None, guidance_method_2_scale=None, guidance_method_2_image=None,
|
||||||
image_prompt_mode=None, image_prompt_image=None, image_prompt_scale=None,
|
image_prompt_mode=None, image_prompt_image=None, image_prompt_scale=None,
|
||||||
|
content_moderation=0,
|
||||||
):
|
):
|
||||||
prompt_enhancement = bool(prompt_enhancement)
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
payload = {
|
payload = {
|
||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
"num_results": 1,
|
"num_results": 1,
|
||||||
@@ -52,6 +54,7 @@ class Text2ImageFastNode():
|
|||||||
"seed": seed,
|
"seed": seed,
|
||||||
"steps_num": steps_num,
|
"steps_num": steps_num,
|
||||||
"prompt_enhancement": prompt_enhancement,
|
"prompt_enhancement": prompt_enhancement,
|
||||||
|
"content_moderation": content_moderation,
|
||||||
}
|
}
|
||||||
if guidance_method_1_image is not None:
|
if guidance_method_1_image is not None:
|
||||||
guidance_method_1_image = preprocess_image(guidance_method_1_image)
|
guidance_method_1_image = preprocess_image(guidance_method_1_image)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from .common import postprocess_image
|
from .common import deserialize_and_get_comfy_key, postprocess_image
|
||||||
|
|
||||||
|
|
||||||
class Text2ImageHDNode():
|
class Text2ImageHDNode():
|
||||||
@@ -19,6 +19,7 @@ class Text2ImageHDNode():
|
|||||||
"prompt_enhancement": ("INT", {"default": 0}),
|
"prompt_enhancement": ("INT", {"default": 0}),
|
||||||
"text_guidance_scale": ("INT", {"default": 5}),
|
"text_guidance_scale": ("INT", {"default": 5}),
|
||||||
"medium": (["photography", "art", "none"], {"default": "none"}),
|
"medium": (["photography", "art", "none"], {"default": "none"}),
|
||||||
|
"content_moderation": ("INT", {"default": 0}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,13 +29,13 @@ class Text2ImageHDNode():
|
|||||||
FUNCTION = "execute"
|
FUNCTION = "execute"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.api_url = "https://engine.prod.bria-api.com/v1/text-to-image/hd/2.3" #"http://0.0.0.0:5000/v1/text-to-image/hd/2.3"
|
self.api_url = "https://engine.prod.bria-api.com/v1/text-to-image/hd/2.2" #"http://0.0.0.0:5000/v1/text-to-image/hd/2.3"
|
||||||
|
|
||||||
def execute(
|
def execute(
|
||||||
self, api_key, prompt, aspect_ratio, seed, negative_prompt,
|
self, api_key, prompt, aspect_ratio, seed, negative_prompt,
|
||||||
steps_num, prompt_enhancement, text_guidance_scale, medium,
|
steps_num, prompt_enhancement, text_guidance_scale, medium, content_moderation=0,
|
||||||
):
|
):
|
||||||
prompt_enhancement = bool(prompt_enhancement)
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
payload = {
|
payload = {
|
||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
"num_results": 1,
|
"num_results": 1,
|
||||||
@@ -45,6 +46,7 @@ class Text2ImageHDNode():
|
|||||||
"steps_num": steps_num,
|
"steps_num": steps_num,
|
||||||
"text_guidance_scale": text_guidance_scale,
|
"text_guidance_scale": text_guidance_scale,
|
||||||
"prompt_enhancement": prompt_enhancement,
|
"prompt_enhancement": prompt_enhancement,
|
||||||
|
"content_moderation": content_moderation,
|
||||||
}
|
}
|
||||||
if medium != "none":
|
if medium != "none":
|
||||||
payload["medium"] = medium
|
payload["medium"] = medium
|
||||||
|
|||||||
@@ -0,0 +1,207 @@
|
|||||||
|
import requests
|
||||||
|
import torch
|
||||||
|
from ..common import deserialize_and_get_comfy_key, postprocess_image, preprocess_image, image_to_base64
|
||||||
|
|
||||||
|
shot_by_text_api_url = (
|
||||||
|
"https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_text"
|
||||||
|
)
|
||||||
|
shot_by_image_api_url = (
|
||||||
|
"https://engine.prod.bria-api.com/v1/product/lifestyle_shot_by_image"
|
||||||
|
)
|
||||||
|
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
class PlacementType(str, Enum):
|
||||||
|
ORIGINAL = "original"
|
||||||
|
AUTOMATIC = "automatic"
|
||||||
|
MANUAL_PLACEMENT = "manual_placement"
|
||||||
|
MANUAL_PADDING = "manual_padding"
|
||||||
|
CUSTOM_COORDINATES = "custom_coordinates"
|
||||||
|
AUTOMATIC_ASPECT_RATIO = "automatic_aspect_ratio"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def validate_api_key(api_key):
|
||||||
|
"""Validate API key input"""
|
||||||
|
if api_key.strip() == "" or api_key.strip() == "BRIA_API_TOKEN":
|
||||||
|
raise Exception("Please insert a valid API key.")
|
||||||
|
|
||||||
|
|
||||||
|
def update_payload_for_placement(placement_type, payload, **kwargs):
|
||||||
|
if placement_type == PlacementType.AUTOMATIC.value:
|
||||||
|
payload["shot_size"] = [
|
||||||
|
int(x.strip()) for x in kwargs.get("shot_size").split(",")
|
||||||
|
]
|
||||||
|
elif placement_type == PlacementType.MANUAL_PLACEMENT.value:
|
||||||
|
payload["shot_size"] = [
|
||||||
|
int(x.strip()) for x in kwargs.get("shot_size").split(",")
|
||||||
|
]
|
||||||
|
payload["manual_placement_selection"] = [
|
||||||
|
kwargs.get("manual_placement_selection", "upper_left")
|
||||||
|
]
|
||||||
|
elif placement_type == PlacementType.CUSTOM_COORDINATES.value:
|
||||||
|
payload["shot_size"] = [
|
||||||
|
int(x.strip()) for x in kwargs.get("shot_size").split(",")
|
||||||
|
]
|
||||||
|
payload["foreground_image_size"] = [
|
||||||
|
int(x.strip()) for x in kwargs.get("foreground_image_size").split(",")
|
||||||
|
]
|
||||||
|
payload["foreground_image_location"] = [
|
||||||
|
int(x.strip()) for x in kwargs.get("foreground_image_location").split(",")
|
||||||
|
]
|
||||||
|
elif placement_type == PlacementType.MANUAL_PADDING.value:
|
||||||
|
payload["padding_values"] = [
|
||||||
|
int(x.strip()) for x in kwargs.get("padding_values").split(",")
|
||||||
|
]
|
||||||
|
|
||||||
|
elif placement_type == PlacementType.AUTOMATIC_ASPECT_RATIO.value:
|
||||||
|
payload["aspect_ratio"] = kwargs.get("aspect_ratio", "1:1")
|
||||||
|
elif placement_type == PlacementType.ORIGINAL.value:
|
||||||
|
payload["original_quality"] = kwargs.get("original_quality", True)
|
||||||
|
|
||||||
|
return payload
|
||||||
|
|
||||||
|
|
||||||
|
def create_text_payload(
|
||||||
|
image, api_key, scene_description, mode, placement_type, **kwargs
|
||||||
|
):
|
||||||
|
|
||||||
|
validate_api_key(api_key)
|
||||||
|
|
||||||
|
|
||||||
|
# Process image
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
|
||||||
|
payload = {
|
||||||
|
"file": image_base64,
|
||||||
|
"placement_type": placement_type,
|
||||||
|
"sync": True,
|
||||||
|
"num_results": 1,
|
||||||
|
"force_rmbg": kwargs.get("force_rmbg", False),
|
||||||
|
"content_moderation": kwargs.get("content_moderation", False),
|
||||||
|
"scene_description": scene_description,
|
||||||
|
"mode": mode,
|
||||||
|
"optimize_description": kwargs.get("optimize_description", True),
|
||||||
|
}
|
||||||
|
|
||||||
|
if kwargs.get("exclude_elements", "").strip():
|
||||||
|
payload["exclude_elements"] = kwargs["exclude_elements"]
|
||||||
|
|
||||||
|
payload = update_payload_for_placement(placement_type, payload, **kwargs)
|
||||||
|
|
||||||
|
return payload
|
||||||
|
|
||||||
|
|
||||||
|
def create_image_payload(image, ref_image, api_key, placement_type, **kwargs):
|
||||||
|
"""Create payload for image-based shot nodes"""
|
||||||
|
validate_api_key(api_key)
|
||||||
|
|
||||||
|
if isinstance(image, torch.Tensor):
|
||||||
|
image = preprocess_image(image)
|
||||||
|
if isinstance(ref_image, torch.Tensor):
|
||||||
|
ref_image = preprocess_image(ref_image)
|
||||||
|
|
||||||
|
image_base64 = image_to_base64(image)
|
||||||
|
ref_image_base64 = image_to_base64(ref_image)
|
||||||
|
|
||||||
|
# Base payload
|
||||||
|
payload = {
|
||||||
|
"file": image_base64,
|
||||||
|
"ref_image_file": ref_image_base64,
|
||||||
|
"enhance_ref_image": kwargs.get("enhance_ref_image", True),
|
||||||
|
"ref_image_influence": kwargs.get("ref_image_influence", 1.0),
|
||||||
|
"placement_type": placement_type,
|
||||||
|
"sync": True,
|
||||||
|
"num_results": 1,
|
||||||
|
"force_rmbg": kwargs.get("force_rmbg", False),
|
||||||
|
"content_moderation": kwargs.get("content_moderation", False),
|
||||||
|
}
|
||||||
|
|
||||||
|
payload = update_payload_for_placement(placement_type, payload, **kwargs)
|
||||||
|
|
||||||
|
return payload
|
||||||
|
|
||||||
|
|
||||||
|
def make_api_request(api_url, payload, api_key, Placement_type = None):
|
||||||
|
"""Make API request and return processed image"""
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
api_key = deserialize_and_get_comfy_key(api_key)
|
||||||
|
headers = {"Content-Type": "application/json", "api_token": f"{api_key}"}
|
||||||
|
response = requests.post(api_url, json=payload, headers=headers)
|
||||||
|
|
||||||
|
if response.status_code == 200:
|
||||||
|
print("response is 200")
|
||||||
|
response_dict = response.json()
|
||||||
|
if Placement_type == PlacementType.AUTOMATIC.value:
|
||||||
|
result_images = []
|
||||||
|
for i, result in enumerate(response_dict.get("result", [])[:7]):
|
||||||
|
image_url = result[0]
|
||||||
|
image_response = requests.get(image_url)
|
||||||
|
processed = postprocess_image(image_response.content)
|
||||||
|
result_images.append(processed)
|
||||||
|
|
||||||
|
# If less than 7 images, pad with None to match ComfyUI return structure
|
||||||
|
while len(result_images) < 7:
|
||||||
|
result_images.append(None)
|
||||||
|
print(result_images)
|
||||||
|
|
||||||
|
return tuple(result_images)
|
||||||
|
|
||||||
|
image_response = requests.get(response_dict["result"][0][0])
|
||||||
|
result_image = postprocess_image(image_response.content)
|
||||||
|
return (result_image,)
|
||||||
|
else:
|
||||||
|
raise Exception(
|
||||||
|
f"Error: API request failed with status code {response.status_code}{response.text}"
|
||||||
|
)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
raise Exception(f"{e}")
|
||||||
|
|
||||||
|
|
||||||
|
def get_common_input_types():
|
||||||
|
"""Get common input types for all nodes"""
|
||||||
|
return {
|
||||||
|
"required": {"api_key": ("STRING", {"default": "BRIA_API_TOKEN"})},
|
||||||
|
"optional": {
|
||||||
|
"force_rmbg": ("BOOLEAN", {"default": False}),
|
||||||
|
"content_moderation": ("BOOLEAN", {"default": False}),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_text_input_types():
|
||||||
|
"""Get text-specific input types"""
|
||||||
|
common = get_common_input_types()
|
||||||
|
common["required"].update(
|
||||||
|
{
|
||||||
|
"image": ("IMAGE",),
|
||||||
|
"scene_description": ("STRING",),
|
||||||
|
"mode": (["base", "fast", "high_control"], {"default": "fast"}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
common["optional"].update(
|
||||||
|
{
|
||||||
|
"optimize_description": ("BOOLEAN", {"default": True}),
|
||||||
|
"exclude_elements": ("STRING", {"default": ""}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return common
|
||||||
|
|
||||||
|
|
||||||
|
def get_image_input_types():
|
||||||
|
"""Get image-specific input types"""
|
||||||
|
common = get_common_input_types()
|
||||||
|
common["required"].update({"image": ("IMAGE",), "ref_image": ("IMAGE",)})
|
||||||
|
common["optional"].update(
|
||||||
|
{
|
||||||
|
"enhance_ref_image": ("BOOLEAN", {"default": True}),
|
||||||
|
"ref_image_influence": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0}),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return common
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "comfyui-bria-api"
|
name = "comfyui-bria-api"
|
||||||
description = "Custom nodes for ComfyUI using BRIA's API."
|
description = "Custom nodes for ComfyUI using BRIA's API."
|
||||||
version = "2.0.0"
|
version = "2.1.7"
|
||||||
license = {file = "LICENSE"}
|
license = {file = "LICENSE"}
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
|
|||||||
@@ -0,0 +1,543 @@
|
|||||||
|
{
|
||||||
|
"id": "3875cd62-7a0e-4c8c-8951-22ec8a63dd8d",
|
||||||
|
"revision": 0,
|
||||||
|
"last_node_id": 14,
|
||||||
|
"last_link_id": 8,
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": 3,
|
||||||
|
"type": "PreviewImage",
|
||||||
|
"pos": [
|
||||||
|
632.3427124023438,
|
||||||
|
32.13115310668945
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
140,
|
||||||
|
26
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 4,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "images",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [],
|
||||||
|
"properties": {
|
||||||
|
"cnr_id": "comfy-core",
|
||||||
|
"ver": "0.3.62",
|
||||||
|
"Node name for S&R": "PreviewImage"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"type": "RefineImageNodeV2",
|
||||||
|
"pos": [
|
||||||
|
704.8090209960938,
|
||||||
|
218.65850830078125
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
287.4712829589844,
|
||||||
|
314
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 5,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "structured_prompt",
|
||||||
|
"type": "STRING",
|
||||||
|
"widget": {
|
||||||
|
"name": "structured_prompt"
|
||||||
|
},
|
||||||
|
"link": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "seed",
|
||||||
|
"shape": 7,
|
||||||
|
"type": "INT",
|
||||||
|
"widget": {
|
||||||
|
"name": "seed"
|
||||||
|
},
|
||||||
|
"link": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "image",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"links": [
|
||||||
|
4
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "structured_prompt",
|
||||||
|
"type": "STRING",
|
||||||
|
"links": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "seed",
|
||||||
|
"type": "INT",
|
||||||
|
"links": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"widgets_values": [
|
||||||
|
"BRIA_API_TOKEN",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"FIBO",
|
||||||
|
"",
|
||||||
|
"1:1",
|
||||||
|
50,
|
||||||
|
5,
|
||||||
|
123456,
|
||||||
|
"randomize"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 4,
|
||||||
|
"type": "PreviewImage",
|
||||||
|
"pos": [
|
||||||
|
1153.29345703125,
|
||||||
|
270.2264404296875
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
140,
|
||||||
|
26
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 8,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "images",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": 4
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [],
|
||||||
|
"properties": {
|
||||||
|
"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": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 6,
|
||||||
|
"type": "Note",
|
||||||
|
"pos": [
|
||||||
|
-47.50065612792969,
|
||||||
|
1042.9178466796875
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
210,
|
||||||
|
95.76702880859375
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 2,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [],
|
||||||
|
"outputs": [],
|
||||||
|
"properties": {},
|
||||||
|
"widgets_values": [
|
||||||
|
"If you would like to start with reference image + prompt"
|
||||||
|
],
|
||||||
|
"color": "#c09430",
|
||||||
|
"bgcolor": "rgba(24,24,27,.9)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 14,
|
||||||
|
"type": "PreviewImage",
|
||||||
|
"pos": [
|
||||||
|
593.5224609375,
|
||||||
|
844.5531616210938
|
||||||
|
],
|
||||||
|
"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
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 3,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "images",
|
||||||
|
"shape": 7,
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "image",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"links": [
|
||||||
|
8
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "structured_prompt",
|
||||||
|
"type": "STRING",
|
||||||
|
"links": [
|
||||||
|
5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "seed",
|
||||||
|
"type": "INT",
|
||||||
|
"links": [
|
||||||
|
6
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"cnr_id": "comfyui-bria-api",
|
||||||
|
"ver": "2.1.5",
|
||||||
|
"Node name for S&R": "GenerateImageNodeV2"
|
||||||
|
},
|
||||||
|
"widgets_values": [
|
||||||
|
"BRIA_API_TOKEN",
|
||||||
|
"",
|
||||||
|
"FIBO",
|
||||||
|
"",
|
||||||
|
"1:1",
|
||||||
|
50,
|
||||||
|
5,
|
||||||
|
123456,
|
||||||
|
"randomize"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"links": [
|
||||||
|
[
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
3,
|
||||||
|
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,
|
||||||
|
0,
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
"IMAGE"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"groups": [],
|
||||||
|
"config": {},
|
||||||
|
"extra": {
|
||||||
|
"ue_links": [],
|
||||||
|
"ds": {
|
||||||
|
"scale": 0.3897342147473183,
|
||||||
|
"offset": [
|
||||||
|
658.5745748406673,
|
||||||
|
99.37411299539059
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"frontendVersion": "1.28.4",
|
||||||
|
"VHS_latentpreview": false,
|
||||||
|
"VHS_latentpreviewrate": 0,
|
||||||
|
"VHS_MetadataImage": true,
|
||||||
|
"VHS_KeepIntermediate": true
|
||||||
|
},
|
||||||
|
"version": 0.4
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"last_node_id":39,"last_link_id":65,"nodes":[{"id":34,"type":"LoadImage","pos":[19.94045066833496,1075.806640625],"size":[315,314],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[61],"slot_index":0,"localized_name":"IMAGE"},{"name":"MASK","type":"MASK","links":null,"localized_name":"MASK"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["quirky-red-brick-brick-wallpaper.jpg","image"]},{"id":36,"type":"PreviewImage","pos":[468.7108154296875,1210.288818359375],"size":[210,246],"flags":{},"order":5,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":63,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":33,"type":"PreviewImage","pos":[1317.4083251953125,1118.4864501953125],"size":[210,246],"flags":{},"order":8,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":59,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":31,"type":"PreviewImage","pos":[1668.734619140625,796.7755737304688],"size":[210,246],"flags":{},"order":10,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":57,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":29,"type":"PreviewImage","pos":[872.8858032226562,679.9429321289062],"size":[210,246],"flags":{},"order":6,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":55,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":28,"type":"LoadImage","pos":[29.629886627197266,676.8370361328125],"size":[315,314],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[54],"slot_index":0,"localized_name":"IMAGE"},{"name":"MASK","type":"MASK","links":null,"localized_name":"MASK"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["pexels-photo-1808399.jpeg","image"]},{"id":35,"type":"RemoveForegroundNode","pos":[414.2638854980469,1079.1705322265625],"size":[315,58],"flags":{},"order":3,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":61,"localized_name":"image"}],"outputs":[{"name":"output_image","type":"IMAGE","links":[62,63],"slot_index":0,"localized_name":"output_image"}],"properties":{"Node name for S&R":"RemoveForegroundNode"},"widgets_values":["BRIA_API_TOKEN"]},{"id":32,"type":"ReplaceBgNode","pos":[834.6115112304688,1063.0406494140625],"size":[315,294],"flags":{},"order":7,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":65,"localized_name":"image"},{"name":"ref_image","type":"IMAGE","link":62,"shape":7,"localized_name":"ref_image"}],"outputs":[{"name":"output_image","type":"IMAGE","links":[59,64],"slot_index":0,"localized_name":"output_image"}],"properties":{"Node name for S&R":"ReplaceBgNode"},"widgets_values":["BRIA_API_TOKEN",false,"",true,true,true,false,"",1978,"randomize"]},{"id":30,"type":"ImageExpansionNode","pos":[1265.001220703125,798.8323974609375],"size":[315,226],"flags":{},"order":9,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":64,"localized_name":"image"}],"outputs":[{"name":"output_image","type":"IMAGE","links":[57],"slot_index":0,"localized_name":"output_image"}],"properties":{"Node name for S&R":"ImageExpansionNode"},"widgets_values":["600,760","200, 0","BRIA_API_TOKEN","1200, 800","",1729,"randomize","Ugly, mutated"]},{"id":38,"type":"Note","pos":[436.7110900878906,566.2047119140625],"size":[306.28387451171875,58],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["You can get your BRIA API token at:\nhttps://bria.ai/api/"],"color":"#432","bgcolor":"#653"},{"id":27,"type":"RmbgNode","pos":[430.8815002441406,678.7727661132812],"size":[315,58],"flags":{},"order":4,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":54,"localized_name":"image"}],"outputs":[{"name":"output_image","type":"IMAGE","links":[55,65],"slot_index":0,"localized_name":"output_image"}],"properties":{"Node name for S&R":"RmbgNode"},"widgets_values":["BRIA_API_TOKEN"]}],"links":[[51,5,0,15,2,"STRING"],[54,28,0,27,0,"IMAGE"],[55,27,0,29,0,"IMAGE"],[57,30,0,31,0,"IMAGE"],[59,32,0,33,0,"IMAGE"],[61,34,0,35,0,"IMAGE"],[62,35,0,32,1,"IMAGE"],[63,35,0,36,0,"IMAGE"],[64,32,0,30,0,"IMAGE"],[65,27,0,32,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8140274938684037,"offset":[101.53311990208498,-477.0342684311694]},"node_versions":{"comfyui-bria-api":"c72754d15b53a13ee0c0419d70401232c56b7fdb","comfy-core":"v0.3.8-1-gc441048","ComfyUI-Jjk-Nodes":"b3c99bb78a99551776b5eab1a820e1cd58f84f31"}},"version":0.4}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"last_node_id":41,"last_link_id":62,"nodes":[{"id":14,"type":"Note","pos":[478,444],"size":[396.80859375,61.8046875],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["Right click, and choose \"Open in Mask Editor\" to draw a mask of areas you want to erase."],"color":"#432","bgcolor":"#653"},{"id":15,"type":"Note","pos":[1080.3062744140625,445.9654541015625],"size":[306.28387451171875,58],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[],"properties":{},"widgets_values":["You can get your BRIA API token at:\nhttps://bria.ai/api/"],"color":"#432","bgcolor":"#653"},{"id":30,"type":"LoadImage","pos":[479,572],"size":[395.7845153808594,352.8512268066406],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[56],"slot_index":0,"shape":3,"localized_name":"IMAGE"},{"name":"MASK","type":"MASK","links":[57],"slot_index":1,"shape":3,"localized_name":"MASK"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["clipspace/clipspace-mask-4068974.800000012.png [input]","image"]},{"id":37,"type":"PreviewImage","pos":[1504.4755859375,568.9967651367188],"size":[438.50262451171875,376.8338317871094],"flags":{},"order":6,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":58,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":33,"type":"PreviewImage","pos":[1502.785888671875,1078.3564453125],"size":[433.29193115234375,357.1255187988281],"flags":{},"order":7,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":54,"localized_name":"images"}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":40,"type":"LoadImage","pos":[541.1226806640625,1079.39697265625],"size":[315,314],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[61],"slot_index":0,"localized_name":"IMAGE"},{"name":"MASK","type":"MASK","links":[62],"slot_index":1,"localized_name":"MASK"}],"properties":{"Node name for S&R":"LoadImage"},"widgets_values":["clipspace/clipspace-mask-4411367.100000024.png [input]","image"]},{"id":34,"type":"BriaGenFill","pos":[1032.416748046875,1073.984619140625],"size":[315,102],"flags":{},"order":5,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":61,"localized_name":"image"},{"name":"mask","type":"MASK","link":62,"localized_name":"mask"}],"outputs":[{"name":"output_image","type":"IMAGE","links":[54],"slot_index":0,"shape":3,"localized_name":"output_image"}],"properties":{"Node name for S&R":"BriaGenFill"},"widgets_values":["a blue coffee mug","BRIA_API_TOKEN"]},{"id":36,"type":"BriaEraser","pos":[1068.6063232421875,574.6080322265625],"size":[315,78],"flags":{},"order":4,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":56,"localized_name":"image"},{"name":"mask","type":"MASK","link":57,"localized_name":"mask"}],"outputs":[{"name":"output_image","type":"IMAGE","links":[58],"slot_index":0,"localized_name":"output_image"}],"properties":{"Node name for S&R":"BriaEraser"},"widgets_values":["BRIA_API_TOKEN"]}],"links":[[54,34,0,33,0,"IMAGE"],[56,30,0,36,0,"IMAGE"],[57,30,1,36,1,"MASK"],[58,36,0,37,0,"IMAGE"],[61,40,0,34,0,"IMAGE"],[62,40,1,34,1,"MASK"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.6727499949325677,"offset":[131.53042816003972,-419.53430403204317]}},"version":0.4}
|
||||||
@@ -1,203 +0,0 @@
|
|||||||
{
|
|
||||||
"last_node_id": 28,
|
|
||||||
"last_link_id": 42,
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"id": 15,
|
|
||||||
"type": "Note",
|
|
||||||
"pos": {
|
|
||||||
"0": 1021,
|
|
||||||
"1": 280
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 311.8914794921875,
|
|
||||||
"1": 153.69827270507812
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 0,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {},
|
|
||||||
"widgets_values": [
|
|
||||||
"The default BRIA API key for ComfyUI (BRIA_ComfyUI_Key) offers 10,000 API calls for the entire community. \n\nGet your own token at:\nhttps://bria.ai/api/"
|
|
||||||
],
|
|
||||||
"color": "#432",
|
|
||||||
"bgcolor": "#653"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 13,
|
|
||||||
"type": "PreviewImage",
|
|
||||||
"pos": {
|
|
||||||
"0": 1410,
|
|
||||||
"1": 160
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 474.7605895996094,
|
|
||||||
"1": 303.117919921875
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 4,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "images",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"link": 42
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "PreviewImage"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 21,
|
|
||||||
"type": "LoadImage",
|
|
||||||
"pos": {
|
|
||||||
"0": 477,
|
|
||||||
"1": 156
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 408.4602355957031,
|
|
||||||
"1": 333.19830322265625
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 1,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "IMAGE",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": [
|
|
||||||
40
|
|
||||||
],
|
|
||||||
"slot_index": 0,
|
|
||||||
"shape": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MASK",
|
|
||||||
"type": "MASK",
|
|
||||||
"links": [
|
|
||||||
41
|
|
||||||
],
|
|
||||||
"slot_index": 1,
|
|
||||||
"shape": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadImage"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
"clipspace/clipspace-mask-82245.69999998808.png [input]",
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 28,
|
|
||||||
"type": "BriaEraser",
|
|
||||||
"pos": {
|
|
||||||
"0": 1022,
|
|
||||||
"1": 159
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 315,
|
|
||||||
"1": 78
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 3,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "image",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"link": 40
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mask",
|
|
||||||
"type": "MASK",
|
|
||||||
"link": 41
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "output_image",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": [
|
|
||||||
42
|
|
||||||
],
|
|
||||||
"slot_index": 0,
|
|
||||||
"shape": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "BriaEraser"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
"BRIA_ComfyUI_Key"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 14,
|
|
||||||
"type": "Note",
|
|
||||||
"pos": {
|
|
||||||
"0": 483,
|
|
||||||
"1": 39
|
|
||||||
},
|
|
||||||
"size": [
|
|
||||||
396.80859375,
|
|
||||||
61.8046875
|
|
||||||
],
|
|
||||||
"flags": {},
|
|
||||||
"order": 2,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {},
|
|
||||||
"widgets_values": [
|
|
||||||
"Right click, and choose \"Open in Mask Editor\" to draw a mask of areas you want animated more. "
|
|
||||||
],
|
|
||||||
"color": "#432",
|
|
||||||
"bgcolor": "#653"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"links": [
|
|
||||||
[
|
|
||||||
40,
|
|
||||||
21,
|
|
||||||
0,
|
|
||||||
28,
|
|
||||||
0,
|
|
||||||
"IMAGE"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
41,
|
|
||||||
21,
|
|
||||||
1,
|
|
||||||
28,
|
|
||||||
1,
|
|
||||||
"MASK"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
42,
|
|
||||||
28,
|
|
||||||
0,
|
|
||||||
13,
|
|
||||||
0,
|
|
||||||
"IMAGE"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"groups": [],
|
|
||||||
"config": {},
|
|
||||||
"extra": {
|
|
||||||
"ds": {
|
|
||||||
"scale": 1,
|
|
||||||
"offset": [
|
|
||||||
-293.75,
|
|
||||||
167.65625
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"version": 0.4
|
|
||||||
}
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
{
|
|
||||||
"last_node_id": 35,
|
|
||||||
"last_link_id": 55,
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"id": 33,
|
|
||||||
"type": "PreviewImage",
|
|
||||||
"pos": {
|
|
||||||
"0": 1420,
|
|
||||||
"1": 574
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 433.29193115234375,
|
|
||||||
"1": 357.1255187988281
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 4,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "images",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"link": 54
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "PreviewImage"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 30,
|
|
||||||
"type": "LoadImage",
|
|
||||||
"pos": {
|
|
||||||
"0": 479,
|
|
||||||
"1": 572
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 395.7845153808594,
|
|
||||||
"1": 352.8512268066406
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 0,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "IMAGE",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": [
|
|
||||||
53
|
|
||||||
],
|
|
||||||
"slot_index": 0,
|
|
||||||
"shape": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "MASK",
|
|
||||||
"type": "MASK",
|
|
||||||
"links": [
|
|
||||||
55
|
|
||||||
],
|
|
||||||
"slot_index": 1,
|
|
||||||
"shape": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "LoadImage"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
"clipspace/clipspace-mask-1438488.400000006.png [input]",
|
|
||||||
"image"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 14,
|
|
||||||
"type": "Note",
|
|
||||||
"pos": {
|
|
||||||
"0": 478,
|
|
||||||
"1": 444
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 396.80859375,
|
|
||||||
"1": 61.8046875
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 1,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {},
|
|
||||||
"widgets_values": [
|
|
||||||
"Right click, and choose \"Open in Mask Editor\" to draw a mask of areas you want to erase."
|
|
||||||
],
|
|
||||||
"color": "#432",
|
|
||||||
"bgcolor": "#653"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 15,
|
|
||||||
"type": "Note",
|
|
||||||
"pos": {
|
|
||||||
"0": 983,
|
|
||||||
"1": 440
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 306.28387451171875,
|
|
||||||
"1": 58
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 2,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {},
|
|
||||||
"widgets_values": [
|
|
||||||
"You can get your BRIA API token at:\nhttps://bria.ai/api/"
|
|
||||||
],
|
|
||||||
"color": "#432",
|
|
||||||
"bgcolor": "#653"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 34,
|
|
||||||
"type": "BriaGenFill",
|
|
||||||
"pos": {
|
|
||||||
"0": 992,
|
|
||||||
"1": 572
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"0": 315,
|
|
||||||
"1": 102
|
|
||||||
},
|
|
||||||
"flags": {},
|
|
||||||
"order": 3,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "image",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"link": 53
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mask",
|
|
||||||
"type": "MASK",
|
|
||||||
"link": 55
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
{
|
|
||||||
"name": "output_image",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"links": [
|
|
||||||
54
|
|
||||||
],
|
|
||||||
"shape": 3,
|
|
||||||
"slot_index": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "BriaGenFill"
|
|
||||||
},
|
|
||||||
"widgets_values": [
|
|
||||||
"a beautiful paint brush",
|
|
||||||
"BRIA_API_TOKEN"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"links": [
|
|
||||||
[
|
|
||||||
53,
|
|
||||||
30,
|
|
||||||
0,
|
|
||||||
34,
|
|
||||||
0,
|
|
||||||
"IMAGE"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
54,
|
|
||||||
34,
|
|
||||||
0,
|
|
||||||
33,
|
|
||||||
0,
|
|
||||||
"IMAGE"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
55,
|
|
||||||
30,
|
|
||||||
1,
|
|
||||||
34,
|
|
||||||
1,
|
|
||||||
"MASK"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"groups": [],
|
|
||||||
"config": {},
|
|
||||||
"extra": {
|
|
||||||
"ds": {
|
|
||||||
"scale": 0.8264462809917364,
|
|
||||||
"offset": [
|
|
||||||
-266.96526103236687,
|
|
||||||
114.47857424738714
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"version": 0.4
|
|
||||||
}
|
|
||||||
+143
-135
@@ -1,18 +1,47 @@
|
|||||||
{
|
{
|
||||||
"last_node_id": 42,
|
"id": "1cdd7d4c-58b5-4047-947b-1977ad36d364",
|
||||||
"last_link_id": 65,
|
"revision": 0,
|
||||||
|
"last_node_id": 14,
|
||||||
|
"last_link_id": 11,
|
||||||
"nodes": [
|
"nodes": [
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 6,
|
||||||
|
"type": "PreviewImage",
|
||||||
|
"pos": [
|
||||||
|
1351.83154296875,
|
||||||
|
26.696861267089844
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
399.811279296875,
|
||||||
|
246
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 5,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "images",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [],
|
||||||
|
"properties": {
|
||||||
|
"Node name for S&R": "PreviewImage"
|
||||||
|
},
|
||||||
|
"widgets_values": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
"type": "LoadImage",
|
"type": "LoadImage",
|
||||||
"pos": {
|
"pos": [
|
||||||
"0": 591,
|
383.92852783203125,
|
||||||
"1": 593
|
38.40964889526367
|
||||||
},
|
],
|
||||||
"size": {
|
"size": [
|
||||||
"0": 315,
|
397.5969543457031,
|
||||||
"1": 314
|
314
|
||||||
},
|
],
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"order": 0,
|
"order": 0,
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
@@ -22,10 +51,9 @@
|
|||||||
"name": "IMAGE",
|
"name": "IMAGE",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"links": [
|
"links": [
|
||||||
64,
|
1,
|
||||||
65
|
3
|
||||||
],
|
]
|
||||||
"slot_index": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MASK",
|
"name": "MASK",
|
||||||
@@ -37,21 +65,21 @@
|
|||||||
"Node name for S&R": "LoadImage"
|
"Node name for S&R": "LoadImage"
|
||||||
},
|
},
|
||||||
"widgets_values": [
|
"widgets_values": [
|
||||||
"A_bottle_of_perfume.png",
|
"CAR.png",
|
||||||
"image"
|
"image"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 39,
|
"id": 2,
|
||||||
"type": "LoadImage",
|
"type": "LoadImage",
|
||||||
"pos": {
|
"pos": [
|
||||||
"0": 600,
|
369.0213623046875,
|
||||||
"1": 988
|
415.34893798828125
|
||||||
},
|
],
|
||||||
"size": {
|
"size": [
|
||||||
"0": 315,
|
450.83685302734375,
|
||||||
"1": 314
|
314.0000305175781
|
||||||
},
|
],
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"order": 1,
|
"order": 1,
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
@@ -61,9 +89,8 @@
|
|||||||
"name": "IMAGE",
|
"name": "IMAGE",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"links": [
|
"links": [
|
||||||
59
|
4
|
||||||
],
|
]
|
||||||
"slot_index": 0
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MASK",
|
"name": "MASK",
|
||||||
@@ -75,21 +102,21 @@
|
|||||||
"Node name for S&R": "LoadImage"
|
"Node name for S&R": "LoadImage"
|
||||||
},
|
},
|
||||||
"widgets_values": [
|
"widgets_values": [
|
||||||
"A_red_studio_with_a_shelf__close_up.png",
|
"seed_713360865.png",
|
||||||
"image"
|
"image"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 15,
|
"id": 5,
|
||||||
"type": "Note",
|
"type": "Note",
|
||||||
"pos": {
|
"pos": [
|
||||||
"0": 995.4524536132812,
|
951.4669189453125,
|
||||||
"1": 601.5353393554688
|
5.085720062255859
|
||||||
},
|
],
|
||||||
"size": {
|
"size": [
|
||||||
"0": 306.28387451171875,
|
210,
|
||||||
"1": 58
|
88
|
||||||
},
|
],
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"order": 2,
|
"order": 2,
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
@@ -103,40 +130,14 @@
|
|||||||
"bgcolor": "#653"
|
"bgcolor": "#653"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 40,
|
"id": 7,
|
||||||
"type": "PreviewImage",
|
"type": "PreviewImage",
|
||||||
"pos": {
|
"pos": [
|
||||||
"0": 1408,
|
1368.5450439453125,
|
||||||
"1": 623
|
340.4889221191406
|
||||||
},
|
|
||||||
"size": [
|
|
||||||
210,
|
|
||||||
246
|
|
||||||
],
|
],
|
||||||
"flags": {},
|
|
||||||
"order": 5,
|
|
||||||
"mode": 0,
|
|
||||||
"inputs": [
|
|
||||||
{
|
|
||||||
"name": "images",
|
|
||||||
"type": "IMAGE",
|
|
||||||
"link": 62
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"outputs": [],
|
|
||||||
"properties": {
|
|
||||||
"Node name for S&R": "PreviewImage"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 41,
|
|
||||||
"type": "PreviewImage",
|
|
||||||
"pos": {
|
|
||||||
"0": 1408,
|
|
||||||
"1": 951
|
|
||||||
},
|
|
||||||
"size": [
|
"size": [
|
||||||
210,
|
387.0335693359375,
|
||||||
246
|
246
|
||||||
],
|
],
|
||||||
"flags": {},
|
"flags": {},
|
||||||
@@ -146,25 +147,26 @@
|
|||||||
{
|
{
|
||||||
"name": "images",
|
"name": "images",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"link": 63
|
"link": 6
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"properties": {
|
"properties": {
|
||||||
"Node name for S&R": "PreviewImage"
|
"Node name for S&R": "PreviewImage"
|
||||||
}
|
},
|
||||||
|
"widgets_values": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 36,
|
"id": 3,
|
||||||
"type": "ShotByTextNode",
|
"type": "ShotByTextOriginal",
|
||||||
"pos": {
|
"pos": [
|
||||||
"0": 996,
|
941.8839111328125,
|
||||||
"1": 736
|
149.14889526367188
|
||||||
},
|
],
|
||||||
"size": {
|
"size": [
|
||||||
"0": 315,
|
273.388671875,
|
||||||
"1": 106
|
202
|
||||||
},
|
],
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"order": 3,
|
"order": 3,
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
@@ -172,7 +174,7 @@
|
|||||||
{
|
{
|
||||||
"name": "image",
|
"name": "image",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"link": 64
|
"link": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -180,31 +182,34 @@
|
|||||||
"name": "output_image",
|
"name": "output_image",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"links": [
|
"links": [
|
||||||
62
|
5
|
||||||
],
|
]
|
||||||
"slot_index": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"Node name for S&R": "ShotByTextNode"
|
"Node name for S&R": "ShotByTextOriginal"
|
||||||
},
|
},
|
||||||
"widgets_values": [
|
"widgets_values": [
|
||||||
"a beautiful sunset",
|
"BRIA_API_TOKEN",
|
||||||
1,
|
"sea",
|
||||||
|
"fast",
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 37,
|
"id": 4,
|
||||||
"type": "ShotByImageNode",
|
"type": "ShotByImageOriginal",
|
||||||
"pos": {
|
"pos": [
|
||||||
"0": 999,
|
945.0781860351562,
|
||||||
"1": 932
|
441.9688415527344
|
||||||
},
|
],
|
||||||
"size": {
|
"size": [
|
||||||
"0": 315,
|
272.0703125,
|
||||||
"1": 102
|
174
|
||||||
},
|
],
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"order": 4,
|
"order": 4,
|
||||||
"mode": 0,
|
"mode": 0,
|
||||||
@@ -212,12 +217,12 @@
|
|||||||
{
|
{
|
||||||
"name": "image",
|
"name": "image",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"link": 65
|
"link": 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ref_image",
|
"name": "ref_image",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"link": 59
|
"link": 4
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputs": [
|
"outputs": [
|
||||||
@@ -225,58 +230,60 @@
|
|||||||
"name": "output_image",
|
"name": "output_image",
|
||||||
"type": "IMAGE",
|
"type": "IMAGE",
|
||||||
"links": [
|
"links": [
|
||||||
63
|
6
|
||||||
],
|
]
|
||||||
"slot_index": 0
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"Node name for S&R": "ShotByImageNode"
|
"Node name for S&R": "ShotByImageOriginal"
|
||||||
},
|
},
|
||||||
"widgets_values": [
|
"widgets_values": [
|
||||||
0,
|
"BRIA_API_TOKEN",
|
||||||
""
|
false,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
1
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"links": [
|
"links": [
|
||||||
[
|
[
|
||||||
59,
|
1,
|
||||||
39,
|
1,
|
||||||
0,
|
0,
|
||||||
37,
|
3,
|
||||||
|
0,
|
||||||
|
"IMAGE"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
"IMAGE"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
4,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
4,
|
||||||
1,
|
1,
|
||||||
"IMAGE"
|
"IMAGE"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
62,
|
5,
|
||||||
36,
|
3,
|
||||||
0,
|
0,
|
||||||
40,
|
6,
|
||||||
0,
|
0,
|
||||||
"IMAGE"
|
"IMAGE"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
63,
|
6,
|
||||||
37,
|
4,
|
||||||
0,
|
0,
|
||||||
41,
|
7,
|
||||||
0,
|
|
||||||
"IMAGE"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
64,
|
|
||||||
42,
|
|
||||||
0,
|
|
||||||
36,
|
|
||||||
0,
|
|
||||||
"IMAGE"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
65,
|
|
||||||
42,
|
|
||||||
0,
|
|
||||||
37,
|
|
||||||
0,
|
0,
|
||||||
"IMAGE"
|
"IMAGE"
|
||||||
]
|
]
|
||||||
@@ -285,12 +292,13 @@
|
|||||||
"config": {},
|
"config": {},
|
||||||
"extra": {
|
"extra": {
|
||||||
"ds": {
|
"ds": {
|
||||||
"scale": 0.9849732675807669,
|
"scale": 0.7513148009015777,
|
||||||
"offset": [
|
"offset": [
|
||||||
-339.6686422794803,
|
11.112206386364164,
|
||||||
-496.4354678014682
|
66.47311795454547
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"frontendVersion": "1.25.11"
|
||||||
},
|
},
|
||||||
"version": 0.4
|
"version": 0.4
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
{
|
||||||
|
"last_node_id": 13,
|
||||||
|
"last_link_id": 11,
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"type": "LoadImage",
|
||||||
|
"pos": [
|
||||||
|
669.7035522460938,
|
||||||
|
136.97129821777344
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
315,
|
||||||
|
314
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 0,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "IMAGE",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"links": [
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"slot_index": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MASK",
|
||||||
|
"type": "MASK",
|
||||||
|
"links": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"Node name for S&R": "LoadImage"
|
||||||
|
},
|
||||||
|
"widgets_values": [
|
||||||
|
"pexels-photo-3246665.png",
|
||||||
|
"image"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 11,
|
||||||
|
"type": "PreviewImage",
|
||||||
|
"pos": [
|
||||||
|
1587.27001953125,
|
||||||
|
97.39167022705078
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
210,
|
||||||
|
246
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 2,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "images",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": 11
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [],
|
||||||
|
"properties": {
|
||||||
|
"Node name for S&R": "PreviewImage"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 10,
|
||||||
|
"type": "Text2ImageFastNode",
|
||||||
|
"pos": [
|
||||||
|
1058.320556640625,
|
||||||
|
96.64427185058594
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
438.71258544921875,
|
||||||
|
394.27716064453125
|
||||||
|
],
|
||||||
|
"flags": {},
|
||||||
|
"order": 1,
|
||||||
|
"mode": 0,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"name": "guidance_method_1_image",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": null,
|
||||||
|
"shape": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "guidance_method_2_image",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": null,
|
||||||
|
"shape": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "image_prompt_image",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"link": 10,
|
||||||
|
"shape": 7
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"name": "output_image",
|
||||||
|
"type": "IMAGE",
|
||||||
|
"links": [
|
||||||
|
11
|
||||||
|
],
|
||||||
|
"slot_index": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"Node name for S&R": "Text2ImageFastNode"
|
||||||
|
},
|
||||||
|
"widgets_values": [
|
||||||
|
"BRIA_API_TOKEN",
|
||||||
|
"A drawing of a lion on a table.\t",
|
||||||
|
"4:3",
|
||||||
|
990,
|
||||||
|
"randomize",
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
"controlnet_canny",
|
||||||
|
1,
|
||||||
|
"controlnet_canny",
|
||||||
|
1,
|
||||||
|
"regular",
|
||||||
|
1
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"links": [
|
||||||
|
[
|
||||||
|
10,
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
10,
|
||||||
|
2,
|
||||||
|
"IMAGE"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
11,
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
"IMAGE"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"groups": [],
|
||||||
|
"config": {},
|
||||||
|
"extra": {
|
||||||
|
"ds": {
|
||||||
|
"scale": 0.7513148009015777,
|
||||||
|
"offset": [
|
||||||
|
11.112206386364164,
|
||||||
|
66.47311795454547
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"node_versions": {
|
||||||
|
"comfy-core": "v0.3.10-42-gff83865",
|
||||||
|
"comfyui-bria-api": "499ec5d104cc5110407eafce468ce1d47ac168b3"
|
||||||
|
},
|
||||||
|
"VHS_latentpreview": false,
|
||||||
|
"VHS_latentpreviewrate": 0
|
||||||
|
},
|
||||||
|
"version": 0.4
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user