Skip to content

feat: v0.2.0 — multi-variant FIBO Generate, mask/spill presets, premultiply flow#2

Merged
dnaulin-bria merged 7 commits into
mainfrom
dev
Jun 1, 2026
Merged

feat: v0.2.0 — multi-variant FIBO Generate, mask/spill presets, premultiply flow#2
dnaulin-bria merged 7 commits into
mainfrom
dev

Conversation

@dnaulin-bria
Copy link
Copy Markdown
Collaborator

Summary

v0.2.0 feature release. Seven per-feature commits.

  • feat(api): extract_image_urls helper for multi-image API responses (also carries Release-As: 0.2.0)
  • feat(generate): multi-variant FIBO Generate (1–4 parallel async calls with per-variant seed offset; Image Index slider + Use This Image button to lock in one variant)
  • fix(recipes): targeted-prompt regressions in object/comp presets — Isolate Object name-only, multi-target placeholder, body-text substitution, possessive handling
  • feat(recipes): Create Mask, Create Soft Mask, and Remove Greenscreen Spill compositing presets
  • feat(recipes): Premultiply with Mask flow + Mask Edge Softness slider — internal Blur → FilterErode → Copy → Premult chain that's hidden + auto-cleared outside the mask presets
  • fix(enhance): route /v2/image/edit/enhance to async (Bria started returning 422 for sync=true in May 2026)
  • docs: README + node reference updated for the v0.2.0 feature surface

Cross-platform audit: all new code is stdlib-only or pure Nuke API. No new platform branches required. Patterns match the (confirmed cross-platform) Houdini release.

Test plan

  • FIBO Generate: toggle "Generate Multiple Images", set Num Images=4, Run → 4 files saved with _v01..v04 suffixes; sidecar JSON lists all 4 in result_paths; Image Index slider switches the internal Read between variants; "Use This Image" promotes the displayed variant
  • FIBO Edit Recipes: Compositing → Create Mask with Element 1 = "the cat" → clean two-tone matte aligned to silhouette; multi-element joins naturally
  • FIBO Edit Recipes: Compositing → Create Soft Mask on a smoke shot → grayscale density matte; solid objects pure black
  • FIBO Edit Recipes: Compositing → Remove Greenscreen Spill on a comp shot → spill/fringing removed, naturally-occurring greens preserved
  • Premultiply with Mask toggle visible only when preset is Create Mask or Create Soft Mask; ON produces clean cutout; switching preset clears the toggle
  • Mask Edge Softness drives blur on the matte without bleeding the silhouette
  • FIBO Edit Recipes: Object → Isolate Object with name-only ("the cat", no modifier) → prompt mentions "the cat" throughout; multi-target Isolate Object joins names with "and"; body text no longer contains "specified object(s)"
  • Enhance: Run on a 1080p image → completes without 422 (async polling path)
  • All View / Copy Generation Data buttons still work on every Bria node (sanity smoke)

cc @assaomri @itayamir @filip-bria

Walks every image URL the Bria API response contains, in order, handling all
the shapes endpoints have used: top-level/result single image_url, list of
strings, list of dicts, and the list-shaped result variant. Required for
multi-variant FIBO Generate to pull every result back, and generally more
robust against API response-shape drift. extract_image_url() (singular) now
delegates to the new plural helper.

Release-As: 0.2.0
Bria's /v2/image/generate endpoint returns one image per call regardless of
batch fields, so true batching is parallel-call style. New "Generate Multiple
Images" toggle exposes a Num Images dropdown (2-4), an Image Index slider, and
a "Use This Image" button. On Run with the toggle ON the node fires N async
calls in parallel via ThreadPoolExecutor; per-variant seed offset gives real
variety when a base seed is set. Saved files are suffixed _v01..vNN next to
the canonical result_path; the slider switches the internal Read between them
without re-running. "Use This Image" promotes the displayed variant to the
canonical result_path so downstream nodes consume the locked-in variant.
Sidecar JSON records every variant in result_paths.
- Isolate Object with only an object name (no modifier) silently fell back to
  the generic prompt instead of using the named target. Multi-target Isolate
  Object substituted the wrong placeholder. Both fixed via new _PRESETS_WITHOUT_MOD
  set covering delete_object and isolate_object — these presets accept name-only
  input; replace/color/material continue to require a modifier.

- Body text retained "the specified object(s)" / "the specified element(s)"
  verbatim even after the action line was substituted, leaving the model with
  ambiguous targeting. New _substitute_body() helper replaces every variant
  (singular, plural, possessive) with the user's joined target phrase, with
  a small possessive helper so "the boots" renders as "the boots'" not
  "the boots's". _build_comp_prompt now also runs the substitution so
  compositing-preset bodies pick up named element(s) too — existing presets
  don't use the placeholders so this is a no-op for them.

- Multi-target joining moved from comma-only to natural English ("a, b, and c")
  via _join_natural().
…l presets

Three new compositing presets, all backed by the existing 5 Element slots —
no new UI parms.

- Create Mask outputs a clean binary alpha matte (white over named element(s),
  black elsewhere) suitable as a luminance key. Uses "rotoscope holdout matte"
  framing with an alignment lock and atmospheric exclusion clause so the result
  is pixel-aligned with the input and free of incidental smoke/dust/fog.

- Create Soft Mask outputs a grayscale density matte for atmospherics — smoke,
  fire, dust, fog, mist — where solid objects in the same frame remain pure
  black. Density follows brightness (white = max density, black = absent, gray
  = partial). Sibling to Create Mask; shares the Premultiply controls.

- Remove Greenscreen Spill removes green/blue-screen color contamination,
  fringing, and edge spill from named element(s) while preserving naturally-
  occurring greens (foliage, signage, wardrobe). Designed to run after the
  keyed subject is composited over its new background.

A _MASK_PRESETS frozenset gates the upcoming Premultiply with Mask + Mask Edge
Softness controls so they only show for the two mask presets.
Adds two new knobs on FIBO Edit Recipes that appear automatically when Create
Mask or Create Soft Mask is the active preset, and are hidden + auto-cleared
otherwise.

- Premultiply with Mask toggle: routes the API-returned mask through an
  internal Blur -> FilterErode -> Copy(rgb=input, a=mask.red) -> Premult
  chain, producing a clean cutout element. OFF returns the raw API mask
  (existing behavior).

- Mask Edge Softness slider: drives the Blur size and a half-size FilterErode
  that compensates for the blur's silhouette expansion, so the alpha stays
  tight to the named element. Smooths the staircase from the model's coarse
  binary output without bleeding the matte.

Visibility is gated on category=compositing AND preset in {create_mask,
create_soft_mask}. Switching preset/category clears the toggle so a stale
ON state cannot affect later non-mask runs.
Bria's /v2/image/edit/enhance endpoint stopped accepting sync=true in May 2026
("sync request is not supported with this endpoint"). adapter.upscale_from_files
now defaults sync=False for the enhance endpoint specifically; other modes
(increase_resolution) keep the prior sync=true default. The Nuke Enhance node
no longer forces sync=true at runtime — BriaClient._poll_status handles the
async response transparently.
- README feature table: multi-variant FIBO Generate, new mask/spill presets in
  FIBO Edit Recipes, View / Copy Generation Data buttons mentioned.
- docs/bria_nuke/README.md: full Multi-variant batch section under FIBO Generate;
  expanded FIBO Edit Recipes section listing Create Mask, Create Soft Mask,
  Remove Greenscreen Spill, Premultiply with Mask, and Mask Edge Softness;
  Enhance sync default updated to reflect async routing.
@dnaulin-bria dnaulin-bria merged commit 1928785 into main Jun 1, 2026
1 check passed
@dnaulin-bria dnaulin-bria deleted the dev branch June 1, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant