Your AI image is 1024px. The canvas is 4 feet wide. Here's the math that saved me.
I build a tool that turns text prompts into wall art you can actually hang — canvas prints, posters, 4×6 ft tapestries. The generation part is the easy part. The part nobody warns you about is this: SDXL hands you a 1024×1024 image. A four-foot tapestry needs roughly 3,500 pixels on the long edge. A poster needs more. For about a month I brute-forced this by upscaling everything 4× and hoping. It…
The AI image generation tool creates wall art that can be hung, including canvas prints, posters, and four-foot tapestries. The initial problem was that the SDXL model produces 1024x1024 images, which don't meet the resolution requirements for larger products like tapestries. The author initially brute-forced the issue by upscaling everything by 4x, causing slow performance, function memory limits, and large file sizes.
After doing the math, the author realized they were solving the wrong problem. The 300 DPI rule applies to items held close to the face, not to large prints viewed from a distance. The author derived a formula based on human visual acuity and viewing distance to determine the required pixels per inch (PPI) for different print sizes and viewing distances.
Applying this formula, the author found that a 4-foot tapestry viewed from six feet only needs 48 PPI, while a 12x16 canvas viewed from two feet needs 2292 PPI. This means that the giant tapestry and small canvas need almost the same number of pixels. The author discovered that a single 4x upscale from 1024px to 4096px covers all size requirements, eliminating the need for a tiered pipeline.
They also learned that upsampling should be done as a queue job, not in the request path, to prevent Out-Of-Memory (OOM) errors. The author concluded that knowing the viewing distance before writing code is crucial for determining the resolution target, memory ceiling, and overall performance.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.