Comfy-Org/ComfyUI · error · ValueError
Bria accepts a width-to-height ratio between {BRIA_MIN_RATIO
Error message
Bria accepts a width-to-height ratio between {BRIA_MIN_RATIO} and {BRIA_MAX_RATIO}: {ratio_width}:{ratio_height} is {aspect_ratio:.4f}. Use the manual expand mode to reach a canvas of any shape. What it means
In Bria expand's 'custom_ratio' mode, the requested width:height ratio must fall between BRIA_MIN_RATIO and BRIA_MAX_RATIO (Bria's API-side canvas limits). The node computes ratio_width/ratio_height and rejects out-of-range ratios before the request, pointing you at manual mode for extreme shapes.
Source
Thrown at comfy_api_nodes/nodes_bria.py:625
cls,
image: Input.Image,
expand_mode: dict,
prompt: str,
negative_prompt: str,
seed: int,
moderation: InputModerationSettings,
) -> IO.NodeOutput:
mode = expand_mode["expand_mode"]
aspect_ratio = canvas_size = original_image_size = original_image_location = None
if mode == "manual":
canvas_size = [expand_mode["canvas_width"], expand_mode["canvas_height"]]
original_image_size = [expand_mode["image_width"], expand_mode["image_height"]]
original_image_location = [expand_mode["image_x"], expand_mode["image_y"]]
elif mode == "custom_ratio":
ratio_width, ratio_height = expand_mode["ratio_width"], expand_mode["ratio_height"]
aspect_ratio = ratio_width / ratio_height
if not BRIA_MIN_RATIO <= aspect_ratio <= BRIA_MAX_RATIO:
raise ValueError(
f"Bria accepts a width-to-height ratio between {BRIA_MIN_RATIO} and {BRIA_MAX_RATIO}: "
f"{ratio_width}:{ratio_height} is {aspect_ratio:.4f}. "
f"Use the manual expand mode to reach a canvas of any shape."
)
else:
aspect_ratio = mode
response = await sync_op(
cls,
ApiEndpoint(path="/proxy/bria/v2/image/edit/expand", method="POST"),
data=BriaExpandRequest(
image=await upload_image_to_comfyapi(cls, image, total_pixels=None, wait_label="Uploading image"),
aspect_ratio=aspect_ratio,
canvas_size=canvas_size,
original_image_size=original_image_size,
original_image_location=original_image_location,
prompt=prompt if prompt else None,
negative_prompt=negative_prompt if negative_prompt else None,
seed=seed,View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Keep the custom ratio within BRIA_MIN_RATIO..BRIA_MAX_RATIO (check the constants in nodes_bria.py, typically around 0.25-4).
- For extreme canvas shapes, switch expand_mode to 'manual' and set canvas_width/canvas_height plus image placement directly.
- Double-check ratio_width and ratio_height are not swapped.
Example fix
// before mode: 'custom_ratio', ratio_width: 16, ratio_height: 1 // after mode: 'manual', canvas_width: 4096, canvas_height: 256, image_width: 512, image_height: 256, image_x: 0, image_y: 0
Defensive patterns
Strategy: validation
Validate before calling
ratio = ratio_width / ratio_height
if not BRIA_MIN_RATIO <= ratio <= BRIA_MAX_RATIO:
mode = 'manual' # fall back to explicit canvas size Prevention
- Keep custom ratios near 1:1..2:1; use manual expand mode for banners or tall posters.
- Sanity-check that ratio_width/ratio_height are in the intended order.
When it happens
Trigger: expand_mode['expand_mode'] == 'custom_ratio' with e.g. ratio_width=10, ratio_height=1 (ratio 10.0) or 1:10, outside the accepted band.
Common situations: User wants a very wide banner or very tall poster via custom ratio; ratio entered reversed (height where width goes) producing an extreme value.
Related errors
- Mask must have the same aspect ratio as the image: image is
- Bria can upscale up to a maximum output dimension of {BRIA_M
- This image cannot be upscaled by Bria at any multiplier: it
- One of prompt or structured_prompt is required to be non-emp
- The mask is empty, so there is nothing to {action}. Masks ar
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/61378ec13598bdf8.
Report an issue: GitHub.