Add Bria 3.2 text-to-image generation node#39
Open
georgi wants to merge 2 commits into
Open
Conversation
Implement a Bria node wrapping the diffusers BriaPipeline for the briaai/BRIA-3.2 commercial-ready text-to-image model. Follows the Flux-based Chroma node pattern (CPU offload, attention slicing, VAE optimizations, progress callback) and applies Bria's required precision fixes: T5 text encoder in bfloat16 with its final dense layer kept in float32, and the VAE kept in float32 when shift_factor is 0. Regenerated package metadata for the new node.
Covers node metadata/defaults, the recommended BRIA-3.2 model, the Bria-specific precision fixes (T5 bfloat16 with float32 final dense layer, VAE float32 only when shift_factor is 0), and move_to_device behavior with and without CPU offload using a mock pipeline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for Bria 3.2, a commercial-ready text-to-image generation model, as a new HuggingFace pipeline node. Bria 3.2 is trained entirely on licensed data and offers high-quality image generation with accurate text rendering capabilities.
Key Changes
New Bria node class (
src/nodetool/nodes/huggingface/text_to_image.py):Briaclass extendingHuggingFacePipelineNodePrecision handling (
_apply_precision_fixesmethod):Memory optimization (
move_to_devicemethod):Comprehensive test suite (
tests/test_text_to_image_bria.py):Metadata registration (
src/nodetool/package_metadata/nodetool-huggingface.json):briaai/BRIA-3.2Notable Implementation Details
asyncio.to_thread()for non-blocking pipeline executionhttps://claude.ai/code/session_017UVzej67SDCFVHVfe6VQ2n