DEV Community

Cover image for How to Generate Multiple Images With AI From a Variation Matrix
Voor AI
Voor AI

Posted on

How to Generate Multiple Images With AI From a Variation Matrix

Generating multiple images reliably is a data-contract problem before it is a prompting problem. Define the invariant visual system once, express only allowed differences in a matrix, generate a small pilot, and validate every output against the same rules.

Define the contract

For a four-icon onboarding set, keep invariants and variables separate:

system:
  canvas: "4:3"
  background: "#F7F8FC"
  stroke: "6px rounded navy"
  lighting: "flat, no shadows"
  forbidden: ["text", "logos", "gradients"]
items:
  - id: upload
    object: "document entering an arrow tray"
    accent: "#6C5CE7"
  - id: review
    object: "magnifier over a four-tile grid"
    accent: "#00B894"
  - id: approve
    object: "check mark inside a shield"
    accent: "#0984E3"
Enter fullscreen mode Exit fullscreen mode

Open the Voor Bulk Assets Creator, choose GPT Image 2 and the Icon set preset, then put the invariant block first. Append one item row per generation.

Voor Bulk Assets Creator configured with shared palette, stroke, lighting, and shape constraints

Build a deterministic prompt function

function promptFor(system, item) {
  return [
    `Create one ${item.object}.`,
    `Canvas ${system.canvas}; background ${system.background}.`,
    `Use ${system.stroke}; accent ${item.accent}.`,
    `${system.lighting}.`,
    `Do not include ${system.forbidden.join(', ')}.`
  ].join(' ')
}
Enter fullscreen mode Exit fullscreen mode

Keep order stable so prompt diffs stay reviewable. Do not inject random style adjectives between rows.

Pilot before the batch

Generate two contrasting items first. The current GPT Image 2 default family estimate observed today was 4 credits, but size/model changes can alter it; confirm the live estimate and public-visibility setting before Generate. If the pilot fails, edit the contract rather than patching each item separately.

Validator

const required = ['canvas', 'background', 'stroke', 'lighting'];
function validateRow(row) {
  const missing = required.filter(k => !row.system?.[k]);
  if (missing.length) throw new Error(`Missing: ${missing.join(', ')}`);
  if (!/^#[0-9A-F]{6}$/i.test(row.item.accent)) throw new Error('Bad accent');
}
Enter fullscreen mode Exit fullscreen mode

Visual QA still needs humans. Check canvas, background, stroke weight, object count, forbidden text, and semantic accuracy. Record pass/fail by item ID.

Troubleshooting

Style drifts: move the shared style block to the beginning and remove synonyms.

Objects multiply: say “one centered object” and reject extra props.

Colors mutate: provide exact hex values plus color names.

One item needs a special exception: add an explicit exceptions field; do not silently change the global contract.

Limits

This is not a transactional batch API: generation may remain variable, and exact pixel identity is not guaranteed. The current model, credit estimate, and availability can change. Public is the current default, so switch it for confidential assets. Generated icons also require license, trademark, and accessibility review.

Once the matrix passes validation, run the small pilot in the exact bulk workspace.

Top comments (0)