All articles/APIs & Integrations
APIs & Integrations#image generation API#template API#bulk render

Image Generation API Explained: Templates, Variables, and Bulk Rendering

Templates, variables, and bulk rendering - how Picnie's image generation API ships creatives at scale.

PI
Picnie
Picnie
Mar 11, 20264 min read

What an image generation API is actually for

Most marketing images are not unique creative decisions made from scratch every time - they are the same layout with a different product photo, headline, and price. An image generation API formalizes that pattern: define the layout once as a template, define what changes as variables, and let a call to the API produce the final image instead of a designer reopening the same file to change a headline.


The template is the reusable layer

A template is a fixed arrangement of elements - a background, a logo position, a headline block, a product photo slot, a price badge - saved once. It encodes every design decision (colors, fonts, spacing, alignment) so no future render needs a human to make those decisions again. Changing the template changes every future render that uses it; it does not retroactively touch images you already generated.


Variables are what actually changes per render

Inside a template, variables are the placeholders: a text field for a headline, an image field for a product photo URL, a color field for a seasonal accent, a number field for a price. A single render call passes values for those variables - "Summer Sale," a specific product photo, "$24.99" - and gets back one finished image built from the template plus that data.

Text, image, and structural variables

Not every variable is text. Image variables swap a photo by URL. Structural variables can toggle whether a badge or a secondary line even appears, which is what lets one template cover both "with discount" and "without discount" variants instead of needing two separate templates.


From one render to a thousand

Bulk rendering is the same request repeated once per row of data - typically sourced from a spreadsheet, a CSV export, or a database query. If a catalog has 500 products, a single template plus a 500-row data source produces 500 on-brand images without 500 individual manual edits. This is the step that actually pays back the time spent building the template correctly.


Synchronous calls vs queued jobs

A single render - one image, one set of variables - is usually fast enough to wait for in the same request, useful for on-demand personalization like generating a social share image the moment a page loads. A batch of hundreds or thousands is usually better queued: submit the job, poll or receive a webhook when it finishes, and collect the output URLs rather than holding a connection open for the whole run.


Where this fits into a marketing stack

  • Ecommerce: one product-card template rendered for every SKU in a feed
  • Paid social: one ad template rendered across dozens of audience or offer variants for testing
  • Personalization: a template rendered per visitor or per recipient with their name or a relevant product
  • Content operations: social graphics generated automatically whenever a new blog post or listing publishes

Keeping renders on-brand as templates multiply

A single template is easy to keep consistent. Ten templates across five campaigns, maintained by three different people, is where brand drift creeps in - a slightly different accent color here, a font swap there, none of it intentional. Before bulk rendering from a new or edited template, compare its output side by side with an existing approved template rather than judging it in isolation; small inconsistencies are far easier to spot next to a known-good reference than on their own. Teams that render at real volume also benefit from a lightweight naming convention for templates themselves, so "the summer sale template" is not a guess three campaigns later. This matters more as the number of active templates grows past what any single person keeps in their head - a quarterly audit of live templates against current brand guidelines is a cheap habit compared to fixing drift after it has already shipped in hundreds of renders.


Getting started without writing code first

Design and test the template visually in Create Images Online before wiring up any automation - confirm the layout survives a very long headline and a very short one, a tall product photo and a wide one. Once the template behaves the way you want across those edge cases, the same template becomes callable through the Picnie API, and connecting it to a spreadsheet or a webhook is a matter of routing data in, not redesigning anything.

#image generation API#template API#bulk render#dynamic images
PI
Written by Picnie

Picnie at Picnie. Writes about image automation, developer experience, and shipping product faster.