ComfyUI Node

Bria Image Replace Background

Product-photo background swaps without cutting out anything by hand

By Runware·Created 2 years ago·Updated about a month ago· 140
Bria Image Replace Background
  • image
  • referenceImages
  • advancedFeatures.watermark.image
  • image
width1024
height1024
positivePrompt
negativePrompt
seed0
numberResults1
advancedFeaturesfalse
advancedFeatures.watermark.bgColor
advancedFeatures.watermark.displayPosition(default)
advancedFeatures.watermark.fontColor
advancedFeatures.watermark.opacityfalse
advancedFeatures.watermark.opacity_value0.10
advancedFeatures.watermark.text
providerSettings.bria.enhanceReferenceImagestrue
providerSettings.bria.forceBackgroundDetectionfalse
providerSettings.bria.modebase
providerSettings.bria.originalQualitytrue
providerSettings.bria.refinePrompttrue
safetyfalse
safety.checkContentfalse
ttlfalse
ttl_value60
outputFormatJPG
outputQuality95

Background removal is the most commoditized operation in the ecosystem, and background replacement is where it stops being commoditized. Plain RMBG-style removal gives you a cutout; this node gives you a cutout and then regenerates the background around it - subject kept, new scene painted in from your prompt, in one pass on Bria's servers. It's the product-photo and portrait-headshot workhorse of this pack, and it's also the most feature-rich Bria node on the list, so let's sort the settings that matter from the ones you'll never touch.

What you actually set

  • image - required. The subject you're keeping.
  • width / height - required, 128–2048 in steps of 64. This is the output canvas the new background is generated at, not the input resolution. If you want the result to stay the same size as the source, set these to match.
  • positivePrompt - optional but basically required in spirit: describe the new background. "Studio backdrop, soft gradient, warm light" is a complete sentence to this model.
  • providerSettings.bria.mode - an enum of base / high_control / fast. This is the speed-vs-prompt-adherence trade: high_control follows a detailed prompt more closely, fast is for cranking through a batch.
  • providerSettings.bria.originalQuality - default on. Keeps the source resolution; turn it off and the output is scaled to ~1MP while preserving aspect ratio. Leave it on unless you're batch-testing.

The settings you can mostly ignore

referenceImages is the interesting optional - an IMAGE batch that acts as a style/look reference for the new background, useful when you want several product shots to share one scene. enhanceReferenceImages and refinePrompt both default on and both do what they say (auto-sharpen references, auto-rewrite your prompt for better results). forceBackgroundDetection only matters if your source already has an alpha channel and the model is skipping detection. seed, numberResults, negativePrompt, safety, output format - all standard, all optional.

Output is a single IMAGE socket. Into Save Image, or straight into an upscale node if you need a hero-size version.

Install

Same one-time setup as the rest of the Runware pack - Manager → search Runware, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt

Restart, add your Runware API key (Settings → Runware API key or RUNWARE_API_KEY). No models download; everything runs cloud-side and the request returns a native IMAGE tensor.

Gotchas

The trap here is forgetting the width/height are the output canvas, not "the source size." Set them once and save the workflow and you're fine. Second: background replacement is two billed steps on the API in effect - detect the subject, generate the background - so it costs more than a plain RMBG call, and numberResults multiplies that. And before you build a product pipeline on it, the FIBO-family licensing rules don't apply here - but Bria's other weights have had license caveats in the past, so glance at the model terms if you're shipping. For personal headshots and product mockups, this node is the fastest path from "photo on a desk" to "photo on a seamless studio background" that exists in ComfyUI.

CategoryRunware/Image/bria

Inputs (27)

NameTypeDefaultDescription
imageIMAGE
widthINT1024128–2048Width of the generated media in pixels.
heightINT1024128–2048Height of the generated media in pixels.
referenceImagesoptIMAGE
advancedFeatures.watermark.imageoptIMAGE
positivePromptoptSTRINGText prompt describing elements to include in the generated output.
negativePromptoptSTRINGPrompt to guide what to exclude from generation. Ignored when guidance is disabled (CFGScale ≤ 1).
seedoptINT00–9223372036854776000Random seed for reproducible generation. When not provided, a random seed is generated in the unsigned 32-bit range.
numberResultsoptINT11–20Number of results to generate. Each result uses a different seed, producing variations of the same parameters.
advancedFeaturesoptBOOLEANfalseEnable to set advancedFeatures. Off uses the model's default.
advancedFeatures.watermark.bgColoroptSTRINGBackground color in hex format.
advancedFeatures.watermark.displayPositionoptCOMBO(default)Watermark position.
advancedFeatures.watermark.fontColoroptSTRINGText color in hex format.
advancedFeatures.watermark.opacityoptBOOLEANfalseEnable to set advancedFeatures.watermark.opacity. Off uses the model's default.
advancedFeatures.watermark.opacity_valueoptFLOAT0.100.1–1Watermark opacity.
advancedFeatures.watermark.textoptSTRINGWatermark text.
providerSettings.bria.enhanceReferenceImagesoptBOOLEANtrueApply additional enhancement to reference images.
providerSettings.bria.forceBackgroundDetectionoptBOOLEANfalseForce background detection even with existing alpha channel.
providerSettings.bria.modeoptCOMBObaseBackground generation behavior controlling quality, prompt adherence and speed.
providerSettings.bria.originalQualityoptBOOLEANtrueRetain original image resolution. When disabled, output is scaled to 1MP while preserving the original aspect ratio.
providerSettings.bria.refinePromptoptBOOLEANtrueAutomatically refine and optimize prompt.
safetyoptBOOLEANfalseEnable to set safety. Off uses the model's default.
safety.checkContentoptBOOLEANfalseEnable or disable content safety checking.
ttloptBOOLEANfalseEnable to set ttl. Off uses the model's default.
ttl_valueoptINT60Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.
outputFormatoptCOMBOJPGFile format for the generated image.
outputQualityoptINT9520–99Compression quality of the output. Higher values preserve quality but increase file size.

Outputs (1)

NameTypeDescription
imageIMAGE