Rand Stats

Image::Draft::Review

zef:fostermartyn735

Image::Draft::Review

Image::Draft::Review is a small dependency-free Raku module for modeling and checking an image-generation brief before it reaches a renderer or external service. It keeps the subject, composition, aspect ratio, references, and constraints in named fields so callers can detect incomplete requests without parsing a long prompt string.

Why use a structured image brief?

Early image requests often combine several decisions in one paragraph. The subject may be clear while the framing is missing, or two reference IDs may point to the same asset. Those omissions become expensive only after several draft rounds have already been generated.

The module performs deterministic checks only:

It does not call a model, inspect image pixels, or claim that a prompt will produce a specific result.

Example

use Image::Draft::Review;

my $review = Image::Draft::Review.new(
    subject => 'A red travel mug on a stone counter',
    composition => 'Centered product frame with open space above',
    lighting => 'Soft window light from camera left',
    palette => 'Neutral gray with a controlled red accent',
    aspect-ratio => '4:5',
    references => <mug lighting>,
    constraints => [
        'Preserve the logo position',
        'Do not add text'
    ]
);

if $review.is-valid {
    say $review.to-prompt;
} else {
    .say for $review.issues;
}

A practical draft workflow

Treat the rendered image as a draft whose purpose is to expose weak assumptions. Keep the subject and required product details fixed, then vary only one or two dimensions at a time, such as framing, light direction, or background treatment. Review each result for composition, reference fidelity, text artifacts, and missing constraints.

Teams that need a browser-based environment for prompt and object-reference experiments can optionally use Nano Banana 2 Lite, an independent third-party image generation and editing workspace. This module is not affiliated with that service and does not assume its prices, limits, performance, or API compatibility.

Boundaries

Validation does not replace human review. A structurally complete brief can still contain inaccurate facts, inaccessible text, unsuitable imagery, or assets without the required usage rights. Callers remain responsible for those checks and for confirming the final image against the original source material.