Compare commits

..
Author SHA1 Message Date
mabualrob1997 725868a7eb Update Readme.md 2025-12-01 16:46:53 +02:00
Yazan Numoor a5a88e2dbd Merge pull request #32 from Bria-AI/WAI-4174
WAI-4174
2025-11-20 11:43:06 +02:00
Ubuntu 64ab007f27 WAI-4174 2025-11-20 07:43:01 +00:00
Yazan Numoor 3ac0209193 Merge pull request #31 from Bria-AI/fix-invalid-token-error-message
fix invalid token error message
2025-11-12 14:31:14 +02:00
Ubuntu b5d4d41bb8 update version 2025-11-12 12:03:13 +00:00
Ubuntu 0f2b1115c5 fix invalid token error message 2025-11-12 09:44:45 +00:00
Yazan Numoor b408c8781a Update pyproject.toml 2025-11-11 15:50:02 +02:00
Yazan Numoor f6e134cfd3 Merge pull request #30 from Bria-AI/WAI-4030
WAI-4030
2025-11-11 15:39:44 +02:00
4 changed files with 63 additions and 23 deletions
+40 -15
View File
@@ -31,28 +31,53 @@ To load a workflow, import the compatible workflow.json files from this [folder]
## Image Generation Nodes
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.
These nodes allow you to leverage Bria's image generation capabilities within ComfyUI. We offer our latest **V2 nodes** (powered by the **FIBO** model) for precise control via structured prompts, alongside our legacy **V1 nodes**.
### V2 Generation Nodes
### V2 Generation Nodes (FIBO)
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.
Our V2 nodes utilize a state-of-the-art **two-step process** for enhanced control and consistency:
| **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. |
- **Translation**: A VLM Bridge translates your input (prompt/images) into a machine-readable `structured_prompt` (JSON).
- **Generation**: The FIBO model generates the final image based on that specific JSON.
### V1 Generation Nodes
**Available Versions:**
- **Regular**: Uses **Gemini 2.5 Flash** as the bridge for state-of-the-art, detailed prompt creation.
- **Lite**: Uses **FIBO-VLM** (Bria's open-source bridge) for faster, flexible, or on-prem deployment.
**Available V2 Nodes & Input Rules**
We offer three distinct nodes to give you full control over this pipeline:
1. **Structured Prompt Bridge**
- Outputs a JSON string only (no image).
- This node decouples the "intent translation" step from generation. It is ideal for "human-in-the-loop" workflows where you want to inspect, audit, or version-control the JSON instructions before generating.
- **Supported Input Combinations:**
- `prompt`: Generates a structured prompt from text.
- `images`: Generates a structured prompt based on an input image.
- `images + prompt`: Generates a structured prompt based on an image, guided by text.
- `structured_prompt + prompt`: Updates an existing structured prompt using new text instructions (outputs updated JSON).
2. **Generate Image**
- Outputs an Image.
- The primary node for generation. It automatically handles translation and generation in one go, or accepts a pre-made structured prompt for reproducible results.
- **Supported Input Combinations:**
- `prompt`: Generates a new image from text.
- `images`: Generates a new image inspired by a reference image.
- `images + prompt`: Generates a new image inspired by an image and guided by text.
- `structured_prompt`: Recreates a previous image exactly (when combined with a seed).
3. **Refine and Regenerate**
- Outputs a Refined Image.
- This node allows you to take a result you like and tweak it without losing the original composition.
- **Supported Input Combination:**
- `structured_prompt + prompt`: Refines a previous image using new text instructions (combined with a seed) to adjust details while maintaining consistency.
### V1 Generation Nodes (Legacy)
These nodes utilize Bria's previous generation pipeline. While V2 is recommended for the highest control and quality, V1 remains available for backward compatibility with established workflows.
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
These nodes use pre-trained tailored models to generate images that faithfully reproduce specific visual IP elements or guidelines.
+20 -6
View File
@@ -8,6 +8,14 @@ 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):
result_image = Image.open(io.BytesIO(image))
result_image = result_image.convert("RGB")
@@ -148,14 +156,20 @@ def poll_status_until_completed(status_url, api_key, timeout=360, check_interval
raise Exception(f"Timeout reached after {timeout} seconds")
def deserialize_and_get_comfy_key(encoded: str):
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['type'] == "comfy"):
return payload['apiKey']
else:
raise Exception(f"Invalid token type")
if payload.get("type") != "comfy":
raise Exception(COMFY_KEY_ERROR)
return payload.get("apiKey")
except Exception as e:
raise Exception(f"Invalid token")
raise Exception(COMFY_KEY_ERROR)
+2 -1
View File
@@ -60,7 +60,8 @@ class GenFillNode():
"seed": seed,
"prompt_content_moderation":prompt_content_moderation,
"visual_input_content_moderation":visual_input_content_moderation,
"visual_output_content_moderation":visual_output_content_moderation
"visual_output_content_moderation":visual_output_content_moderation,
"version": 2
}
headers = {
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-bria-api"
description = "Custom nodes for ComfyUI using BRIA's API."
version = "2.1.5"
version = "2.1.8"
license = {file = "LICENSE"}
[project.urls]