// TRANSMISSION LOG /

Your dog, in stained glass: a proof of concept for an Etsy shop that runs itself

A buyer uploads one photo at checkout. A few minutes later a leaded-glass portrait of their dog is on its way to a print partner, and tracking lands back on the order without anyone touching it. Here's what we built, why, and how we're tuning the art with a small lab page.

#etsy #printify #gemini #automation #side-project

What would our dog look like in a church window?

That was the whole idea. Pet portraits sell on Etsy, Christmas ornaments sell on Etsy, and image models have gotten good enough at material and craft that "a head-and-chest portrait of this exact dog, cut from streaky cathedral glass with real lead came" is a prompt that can come back looking like a photograph of a real panel. The business question was whether a shop like that could run with nobody in the loop: order comes in, art gets made, product gets printed and shipped, tracking goes back to the buyer. One listing, one ceramic ornament, and a pipeline doing the rest.

This post is about that pipeline, and about the part that turned out to matter most: how you refine a prompt when every run of the model is a dice roll.

The product

A round white ceramic ornament, about three inches, with the portrait printed on both sides. The buyer uploads one photo of their pet at checkout and optionally types a name. On the listing they pick two things from dropdowns:

  • Background: Midnight Blue, Amber Sunburst, Christmas Green & Ruby, Plum & Rose, or Winter Frost.
  • Glass color: Natural colors, Jewel tones, or Grayscale.

Natural keeps the pet's real coat in glass. Jewel tones recuts the coat in ruby, cobalt, emerald, gold and rose, the bold colors of a rose window, while keeping every marking so the dog is still recognizable. Grayscale renders the pet in clear, white, grey and black glass against a colored background. Fifteen looks on a single listing.

The pipeline

It's a small Node service on Railway. No framework beyond Express, a JSON file on a persistent volume for state, and three outside services.

  1. Etsy tells us about a paid order, either by webhook or by a poll every few minutes. We pull the receipt, find the uploaded photo and the two dropdown choices.
  2. Gemini does the art in two steps. A text model looks at the photo first and returns a bounding box for the head and chest plus a short description of the coat: "grizzled grey-brown sable with tan points, dark mask, semi-erect ears." Then an image model gets a crop of the photo, a tight close-up of the face, three reference photos of real backlit stained glass, and a prompt built from the buyer's two choices.
  3. Printify receives the finished print file and the shipping address, prints the ornament and ships it. When it ships, a webhook brings the tracking number back and we post it to the Etsy order.

Between steps two and three there is a deterministic finishing pass: the artwork is cropped to a standard composition, resized to print resolution, and a soldered lead rim is drawn around the circle so the ornament reads as a real suncatcher.

A small console sits on top. It shows orders, the artwork for each, revenue and cost per order, and a few controls that matter when you're letting software spend money: a pause switch, a daily cap on image generations and dollars, and a toggle for whether orders go straight to production or wait for a human to approve the art. For the first weeks that toggle stays on "approve", because the point of a proof of concept is to find out what goes wrong.

The lab

The pipeline was the easy part. The hard part was the art, and specifically consistency. One run would be lovely. The next, same photo, same prompt, would draw the dog twice as large with its ears cut off by the circle, or tiny and floating in a sea of glass, or with a straight lead line across the background like a window sash.

So we built a page in the console called the lab. You drop in pet photos, tick any set of backgrounds and glass colors, and it generates every combination through the real pipeline, exactly as an order would. Results show masked onto the ornament, grouped by photo or by variant, with time and cost per image, the prompt that was used, and a download of the print file. When a result is wrong you can edit the coat description the vision model wrote and regenerate, or just regenerate and pick.

That last part became the method. The lab keeps every attempt as its own card and marks which one the pipeline's scoring would have shipped. A person judges likeness far better than any score, so in the lab the human picks. In production, where nobody is watching, the score picks. Everything we learned about the prompt came from staring at grids of these cards and asking what the bad ones had in common.

What we learned, in the order it hurt

Crop before you prompt. Sending the whole photo gave flat clip art. Cropping to the head and chest, so the model sees a face and not a living room, was the single biggest likeness win. Folding the coat description into the prompt was second, because colors stated in words survive better than colors shown in pixels.

The model inflates whatever it's shown. We wanted the portrait large but with the ears inside the ring. Ask for 70% and you get 90%. Ask for 55% and you get 70%. The input crop sets the framing more than the words do, so now the crop is composed to the target shape, head about 40% of the width with the chest at the bottom edge, and the prompt asks for a smaller dog than we want back.

Normalize after, don't beg before. No wording held the size steady from run to run. What did was measuring the output. The vision model locates the top of the head and both ear tips in the finished art, and a planner finds the largest zoom at which those points clear the rim, with the head as high as the ears allow and the chest running off the bottom. The ring clearance decides the size, not the model's mood. Every ornament gets the same composition.

Bounding boxes lie on stained glass. The vision model's "head" box on a glass portrait spans the shoulders. Points are honest; boxes aren't. And a box's top corners are empty glass beside a droopy ear, so testing corners against a circle rejects good images.

Zoom out by painting, not by asking. When a dog is drawn too big to fix by zooming in, the only true fix is more background. Asking the model to "zoom out" did nothing. Padding the image with a mirrored border and asking it to repaint the border, it kept the reflections. Padding with a flat grey border and asking it to fill the grey with matching glass worked, and left the dog untouched. That matters because a regenerate changes the likeness and the first draw was often the best one.

Trust the measurement less the more you zoom. On tall erect ears the model reads the tips short of where they really are, and a 1.8× zoom turns a small error into a clipped ear. So the framed window gets located a second time, where the dog is bigger and the points are more accurate, and the zoom backs off if the ears are actually at the ring.

Tell the retry what was wrong. A second attempt that just says "try again" is a coin flip. One that says "the ears reached the edge, draw the head smaller" or "the chest stopped short, run it off the bottom" lands most of the time. We keep the best-scored attempt, not the last.

Each of those was found the same way: generate a grid in the lab, mark what's wrong, change one thing, generate again. The lab counts every generation against the same daily caps as orders, so a tuning session can't quietly run up a bill. A full round of four images at the print size costs under a dollar.

Where it is

The service is deployed, the console has real user accounts with two-factor sign-in, and the listing copy is written. What's left is the boring part: the Etsy developer app approval, the Printify token, a sample ornament in hand to photograph for the listing, and then a test purchase through the whole chain. After that we turn the approval toggle off and see what a week of orders looks like.

If it works, the same pipeline can feed other blanks on the print partner's catalog: a glass ornament, a mug, a blanket with a border. The art is the hard part and it's already square.

The honest caveat

It is still non-deterministic. The framing is now consistent and the ears stay inside the ring, but likeness varies between runs, and some photos, a dark dog in a dark room, a cat looking away, will produce art a buyer wouldn't recognize. The approval step exists because of that, and the lab exists so that over time fewer orders need it. The proof of concept isn't "software made an ornament." It's "software made a hundred, and how many did a human have to touch."