← Engineering creative generation pipelines

Part 2 of 6 · 5 min read

Image generation: Nano Banana, local models and structured prompts

An exact image request, structured creative prompts, local model alternatives and the approved-keyframe boundary.

Arunank Sharan · Kuzushi Labs ·

In this article

The image stage establishes the campaign’s composition before motion adds more variability. Its output should be an approved keyframe with known provenance, not simply the first attractive image produced by a model.

The reference supports a managed Nano Banana route alongside the self-hosted ComfyUI experiments recovered from XGen’s samples. The two routes share an output contract while exposing different controls.

Name the model explicitly

“Nano Banana” is a product name used across an evolving image-model family. The example here selects the original gemini-2.5-flash-image model explicitly. Google’s current documentation distinguishes it from later models. The choice preserves the requested technical lineage; a new deployment should confirm availability and compare supported alternatives before freezing its release. Google image-model documentation

The model name belongs in the run manifest. It should not be hidden behind a generic alias that can change without altering the recorded configuration.

Separate the brief from the provider request

An application brief can contain campaign identity, asset rights, review instructions and output destinations. Those fields do not all belong in the provider’s request body.

The downloadable Nano Banana request contains a contents message and generationConfig with text/image response modalities and a 16:9 image configuration. The model is selected in the API endpoint:

POST /v1beta/models/gemini-2.5-flash-image:generateContent

Authentication belongs in the request header or provider SDK, outside the JSON stored with the creative job. The reference request has no API key. Preserve the provider’s response identity and returned image bytes separately from the original creative brief.

Write for composition, not just style

The example asks for one matte cobalt reusable bottle on a pale stone plinth, with soft side lighting, a stable silhouette and empty space reserved for copy. These constraints help review because they describe observable properties.

{
  "subject": "one matte cobalt reusable bottle",
  "composition": "three-quarter product view; upper-right space for copy",
  "lighting": "soft daylight from camera left; subtle rim light",
  "background": "quiet warm-grey studio",
  "preserve": ["bottle silhouette", "cap geometry", "product color"],
  "exclude": ["extra products", "people", "generated lettering"]
}

This is a brief fragment, not a provider API schema. The application renders it into the text in the actual request. Keep both versions so an operator can inspect how the brief became a prompt.

For a real campaign, an authorized product reference is stronger than expecting prose alone to reproduce exact packaging. Review generated details against that reference, and keep exact logos, prices and regulated claims in a controlled compositing step when necessary.

The recovered local-image route

The XGen graphs reference several concrete image components: JibMix Realistic XL variants, Juggernaut XL, flux1-dev-fp8.safetensors and flux1-kontext-dev.safetensors. They also contain detailers, upscalers and LoRA loaders.

A local image recipe needs an internally compatible bundle. SDXL and FLUX use different model architectures and conditioning components. A file can be syntactically loadable and still be the wrong adapter for the base model. Record model-family identity and validate the effect through an ablation, rather than using “LoRA support” as a blanket guarantee.

The public component inventory retains selected filenames and unresolved provenance fields. It does not redistribute the weights or claim that every experimental component is approved for commercial work.

Approve the frame before preparing it for Wan

The motion reference expects a prepared 832 × 480 image. A 16:9 image from the provider is close to, but not exactly, that aspect ratio. Blind stretching changes the product; silent cropping can remove its cap or the space reserved for text.

Choose a reviewed crop or padding policy, then save the exact prepared file under a new hash. The image that the reviewer approved and the image supplied to the video model should be traceably connected.

The Wan graph uses both image conditioning and a vision-encoder representation. Its vision-encoder crop behavior is another reason to keep the primary subject clearly composed and to inspect the actual prepared input.

What to persist

Save the brief revision, model ID, rendered request, input references, provider response ID, candidate image hash, approval record and prepared image hash. For the local route, also save checkpoint and LoRA hashes, strengths, sampler, schedule and seed.

A candidate can be rejected without losing the record. Rejection reasons such as incorrect silhouette, unwanted text or unsuitable composition become useful evidence for changing the prompt or model route.

Evaluate controlled variation

Change one major dimension at a time: background, lighting or camera. Keep the product identity and evaluation rubric fixed. Compare candidate sets rather than selecting one unusually good sample and attributing it to the entire configuration.

The right output metric is the fraction of candidates accepted for the next stage, with review effort and cost attached. Once a keyframe passes, stop changing it while tuning the motion prompt. Otherwise it becomes impossible to tell whether a video improvement came from the video model or from a better starting image.