Turn one photo into four ad sizes with a Pixelflow

Photo, logo and three lines of copy in; a 1:1 post, 4:5 post, story and LinkedIn ad out, with real fonts. One Pixelflow run, $0.30.

One photo, your logo and three lines of copy in. An Instagram post, a square post, a story and a LinkedIn ad out, with every word set in a real font and your logo placed exactly as you uploaded it. One run takes about 30 seconds and costs $0.30.

This Pixelflow is a single step: the Video Editor Agent's layered design renderer, with a fixed layout and your inputs dropped into it. Because the layout is fixed and checked, it works on most photos without anyone tuning it.

  • 1:1, 1080x1080
  • 4:5, 1080x1350
  • 9:16, 1080x1920
  • 1.91:1, 1200x628
One run of the Pixelflow: four sizes from one photo, one logo and three lines of copy

What goes in

InputKindExample
photoImageA room, a product on a table, a plate of food
logoImageYour logo, ideally a PNG with a transparent background
headlineTextYour first home, sorted.
sublineText2 and 3 BHK in Whitefield from ₹89 lakh
button_labelTextBook a site visit
brand_colorText#1F3A5F (the button colour)
button_textwhite or blackwhite
headline_fontPlayfair Display, DM Serif Display, Fraunces, Anton, Bebas Neue or OswaldPlayfair Display
logo_panelwhite or blackwhite (use black for a white logo)

What comes out

designs is a list of five URLs: a contact sheet with every size side by side, then the 1:1 post, the 4:5 post, the 9:16 story and the 1.91:1 link ad, as PNGs.

The layout is the same in every size: the photo full bleed, a soft shade rising from the bottom, your logo on a small panel at the top left, and the words and button over the shade. The text boxes are fixed; the renderer picks the largest type that fits each one, so a short headline is set big and a long one wraps. On a bright photo it adds a darker shade behind the words only where contrast needs it.

  • Contact sheet, all four sizes
  • The 4:5 post
The same Pixelflow with a café's photo, Anton for the headline and a clay button

Run it from your code

The Pixelflow is published as an API. Send the inputs, then poll until the run is done:

import requests, time, json

api_key = "YOUR_SEGMIND_API_KEY"
url = "https://api.segmind.com/workflows/v2/6b0bc4f1c56bf6b0dca0dc61-v2"
data = {
    "photo": "https://images.segmind.com/public/e944d1cb9489adc269574b794214b136.jpeg",
    "logo": "https://images.segmind.com/public/1ce4a03968c005ec64eb90506c7baa67.png",
    "headline": "Your first home, sorted.",
    "subline": "2 and 3 BHK in Whitefield from ₹89 lakh",
    "button_label": "Book a site visit",
    "brand_color": "#1F3A5F",
    "button_text": "white",
    "headline_font": "Playfair Display",
    "logo_panel": "white",
}
submit = requests.post(url, json=data, headers={"x-api-key": api_key}).json()

while True:
    result = requests.get(submit["poll_url"], headers={"x-api-key": api_key}).json()
    if result["status"] == "COMPLETED":
        print(json.loads(result["output"]))
        break
    if result["status"] == "FAILED":
        raise RuntimeError(result.get("error", "Generation failed"))
    time.sleep(7)

The photo and logo must be Segmind URLs: a generation, a file in your asset library, or a file sent through Segmind's upload API.

Build your own version in the Pixelflow editor

The whole Pixelflow is one Video Editor Agent node, so it is easy to make your own with a different layout, more sizes or a second text line.

  1. Add the inputs: two image inputs (photo, logo) and text inputs for the copy and colours.
  2. Add a Video Editor Agent node. Set Response format to json.
  3. Connect photo and logo to its Input files. The renderer accepts a design's own pictures as attachments and renders the URLs inside the design.
  4. Paste the design below into its Instruction (the prompt). Each {{ name }} is filled from the input of that name when the flow runs.
  5. Connect the node's output to the flow's output.
Design render:
{"schema":"segmind.design/1","name":"ad-set","brand":{"palette":{"white":"#FFFFFF","black":"#111114","brand":"{{ brand_color }}"},"fonts":{"display":{"family":"{{ headline_font }}"},"body":{"family":"Inter"}}},"assets":{"photo":{"src":"{{ photo }}","origin":{"type":"user"}},"logo":{"src":"{{ logo }}","origin":{"type":"user"}}},"layers":[{"id":"background","type":"image","asset":"photo","role":"plate"},{"id":"shade","type":"gradient","stops":[["black",0,0],["black",0.62,38],["black",0.9,100]]},{"id":"logo","type":"logo","asset":"logo","panel":"{{ logo_panel }}"},{"id":"headline","type":"text","text":"{{ headline }}","font":"display","color":"white","line_height":1.05,"valign":"bottom","scrim":"auto"},{"id":"subline","type":"text","text":"{{ subline }}","font":"body","weight":500,"color":"white","scrim":"auto"},{"id":"cta","type":"button","text":"{{ button_label }}","font":"body","weight":700,"fill":"brand","color":"{{ button_text }}"}],"formats":{"ig-feed-1x1":{"preset":"ig-feed-1x1","background":{"asset":"photo"},"boxes":{"shade":{"x":0,"y":30,"w":100,"h":70},"logo":{"x":7,"y":7,"w":24,"h":7},"headline":{"x":7,"y":50,"w":86,"h":22},"subline":{"x":7,"y":74,"w":80,"h":5},"cta":{"x":7,"y":82}}},"ig-feed-4x5":{"preset":"ig-feed-4x5","background":{"asset":"photo"},"boxes":{"shade":{"x":0,"y":34,"w":100,"h":66},"logo":{"x":7,"y":6,"w":26,"h":6},"headline":{"x":7,"y":56,"w":86,"h":18},"subline":{"x":7,"y":76,"w":80,"h":4},"cta":{"x":7,"y":83}}},"story-9x16":{"preset":"story-9x16","background":{"asset":"photo"},"boxes":{"shade":{"x":0,"y":28,"w":100,"h":72},"logo":{"x":8,"y":15,"w":34,"h":5},"headline":{"x":8,"y":45,"w":84,"h":23},"subline":{"x":8,"y":69.5,"w":84,"h":3.4},"cta":{"x":8,"y":75.5}}},"link-1.91x1":{"preset":"link-1.91x1","background":{"asset":"photo"},"boxes":{"shade":{"x":0,"y":25,"w":100,"h":75},"logo":{"x":4,"y":8,"w":18,"h":10},"headline":{"x":4,"y":40,"w":70,"h":26},"subline":{"x":4,"y":67,"w":64,"h":8},"cta":{"x":4,"y":78}}}}}

To change the layout, change the boxes: x, y, w and h are percent of the frame. To add a size, add a format with a preset such as reels-9x16, yt-thumb-16x9, mrec-300x250 or a4-portrait, with a box for each layer. The API guide to layered designs lists every preset and field.

Generate the photo in the same flow

No photo yet? Put an image model in front. A Nano Banana 2 step at 2K ($0.126) with a prompt such as "a sunlit living room with floor to ceiling windows, calm empty wall in the upper half, no text" feeds photo, and the run costs $0.43 in all.

Tips

  • Keep double quotes out of the copy. The copy goes into JSON, and a " inside it breaks the design. Apostrophes are fine.
  • Write the colour as #RRGGBB. Pick black button text for a light brand colour, white for a dark one.
  • Choose photos with a calm lower half. The words sit there, over the shade.
  • A white logo needs the black panel. The renderer checks the logo stands out from what is behind it.

What it costs

StepPrice
Render and check all four sizes$0.30 per run
Optional: generate the photo with Nano Banana 2 at 2K$0.126

Want the design written for you?

This Pixelflow fixes the layout so it runs without decisions. For a layout made for your brief, ask Pixi: it writes a design for your copy and your sizes, checks it, and fixes it before you see it.

This model is unavailable.

  • #pixelflow
  • #design
  • #ads
  • #social-media
  • #automation
RR

Rohit Ramesh

@rohit

Building Segmind. The Pixelflows I make for product shots, fashion, video ads and voice, and the prompts behind them.

View profile

Posts

More from Rohit Ramesh

Make your own with Segmind

Run every model and Pixelflow in this post, and build your own workflows.

Start creating