module

MJ::Arcana::Cameras

Constants

ALL = [Camera.new(id: "klein", label: "FLUX.2 Klein 9B", model: "runware:400@2", cost: 0.0059, seconds: 9.6, quality: 1, range: KLEIN_RANGE, seeds: true, note: "The little camera that could. Unremarkable but dependable; cheapest that holds a character.", extra: steps(20, 3.5)), Camera.new(id: "flare", label: "GPT-Image 2.5 Flare", model: "openai:gpt-image@2.5-flare", cost: 0.0148, seconds: 17.0, quality: 2, range: GPT25_RANGE, pixels: GPT25_PIXELS, note: "Ambitious staging, livelier compositions, but more prone to anatomy mistakes. Shares failure modes with Sunburst — not an independent fallback."), Camera.new(id: "sunburst", label: "GPT-Image 2.5 Sunburst", model: "openai:gpt-image@2.5-sunburst", cost: 0.0139, seconds: 20.0, quality: 2, range: GPT25_RANGE, pixels: GPT25_PIXELS, note: "Flare's sibling. Fails on the same prompts Flare does."), Camera.new(id: "lite", label: "Nano Banana 2 Lite", model: "google:nano-banana@2-lite", cost: 0.0340, seconds: 6.1, quality: 3, dims: NANO_DIMS, note: "The fastest thing measured. Imposes its own house style and is nearly indifferent to how good the reference is."), Camera.new(id: "nano", label: "Nano Banana 2", model: "google:4@3", cost: 0.0692, seconds: 12.5, quality: 4, dims: NANO_DIMS, note: "Richest colour and staging. Google's content filter is strict AND probabilistic — identical prompts pass and fail minutes apart. Refusals are not billed, so retry is free but costs latency."), Camera.new(id: "hero", label: "GPT Image 1.5", model: "openai:4@1", cost: 0.1362, seconds: 20.0, quality: 5, dims: HERO_DIMS, note: "Premium. Twice Nano's price — for the shot that matters, not for every panel."), Camera.new(id: "dflare", label: "GPT-Image 2.5 Flare (direct)", model: "gpt-image-2.5-flare", cost: 0.0148, seconds: 10.6, quality: 2, range: GPT25_RANGE, pixels: GPT25_PIXELS, provider: "openai", note: "Same model as `flare`, on an independent queue. Reach for this when Runware is congested or when you need to spread sustained load."), Camera.new(id: "dsunburst", label: "GPT-Image 2.5 Sunburst (direct)", model: "gpt-image-2.5-sunburst", cost: 0.0139, seconds: 11.5, quality: 2, range: GPT25_RANGE, pixels: GPT25_PIXELS, provider: "openai", note: "Same model as `sunburst`, independent queue. Shares Flare's failure modes, so not a fallback for `dflare` either."), Camera.new(id: "dhero", label: "GPT Image 1.5 (direct)", model: "gpt-image-1.5", cost: 0.1362, seconds: 33.3, quality: 5, dims: HERO_DIMS, provider: "openai", extra: {"input_fidelity" => JSON::Any.new("high")}, note: "Same model as `hero`, independent queue. The only direct camera that accepts input_fidelity, so the best of the three at holding a reference."), Camera.new(id: "dnano", label: "Nano Banana 2 (direct)", model: "gemini-3.1-flash-image", cost: 0.0672, seconds: 12.5, quality: 4, dims: GOOGLE_DIMS, provider: "google", note: "Same model as `nano`, independent queue, cost computed from reported tokens. Google's content filter is strict AND probabilistic — identical prompts pass and fail minutes apart, and refusals are unbilled."), Camera.new(id: "dlite", label: "Nano Banana 2 Lite (direct)", model: "gemini-3.1-flash-lite-image", cost: 0.0336, seconds: 2.8, quality: 3, dims: GOOGLE_DIMS, provider: "google", note: "The fastest camera here by a wide margin — ~2.8s measured, against 6.1s for the same model through Runware. First choice for a live path."), Camera.new(id: "kontext", label: "FLUX Kontext dev", model: "bfl:3@1", cost: 0.0400, seconds: 8.7, quality: 1, dims: KONTEXT_DIMS, note: "Conservative to a fault: preserves the reference faithfully but barely restyles. Poor at transformation, good at leaving things alone.")]
BY_ID = ALL.to_h do |c| {c.id, c} end
GOOGLE_DIMS = [[1024, 1024], [512, 2064], [352, 2928], [848, 1264], [1264, 848], [896, 1200], [2064, 512], [1200, 896], [928, 1152], [1152, 928], [2928, 352], [768, 1376], [1376, 768], [1584, 672]]

Gemini's direct API takes an aspect RATIO, not pixel dimensions, and these are the sizes its 14 legal ratios actually produce — measured one call at a time, not read off a page. Eight match the Nano sizes probed through Runware exactly, which is good evidence the set belongs to the model rather than the aggregator. Two do not exist through Runware at all (928x1152, 1152x928), and four are extreme panoramas: 8:1 gives 2928x352 in a single generation, at the same token cost as a square.

GPT25_PIXELS = {655360, 8294400}

Runware's validator states it outright: "Total pixels (width x height) must be between 655360 and 8294400." Confirmed independently against OpenAI direct, where 589,824 px is refused and 745,472 px accepted. Both pools, because it belongs to the model rather than the aggregator.

GPT25_RANGE = {16, 3840, 16}
HERO_DIMS = [[1024, 1024], [1536, 1024], [1024, 1536]]

GPT Image 1.5 publishes a very short list.

KLEIN_RANGE = {128, 2048, 16}

Ranges, read off the API's own rejection messages: {min, max, step}.

KONTEXT_DIMS = [[1568, 672], [1392, 752], [1184, 880], [1248, 832], [1024, 1024], [832, 1248], [880, 1184], [752, 1392], [672, 1568]]

FLUX Kontext publishes a different fixed set again.

NANO_DIMS = [[1024, 1024], [1376, 768], [768, 1376], [1548, 672], [1584, 672], [1200, 896], [896, 1200], [1264, 848], [848, 1264]]

Nano Banana's fixed set. There is no 1024x768 and no 768x1024 — the two sizes a comic panel most wants — so those snap to 1200x896 / 896x1200, which are within 0.5% of 4:3 and slightly larger.

REFERENCE_BLIND = Set {"runware:100@1"}

Models that silently DISCARD a reference image. Sending one costs money and changes nothing — FLUX.1 schnell returns a byte-identical image with and without. Kept here so the service can refuse rather than quietly charge for a no-op.

Class methods

find(id : String) : Camera | Nil
Source
list
Source
pools

Which cameras are independent capacity pools, grouped by transport. With one transport this is a single group of seven, which is exactly the thing worth being able to see: a spike cannot be spread across these by picking different cameras.

Source
steps(n : Int32, cfg : Float64) : Hash(String, JSON::Any)
Source