跪拜 Guibai
← All articles
Frontend · Backend · AI Programming

Three Nights on an 8GB GPU: Building an Image Site With an AI Coding Agent

By Younglina ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Local image generation is practical on a modest consumer GPU, and an AI coding agent can compress a three-week build into three nights. The limiting factor becomes learning how the model fails: negative prompts, upscaling, and lighting wording all behave counterintuitively.

Summary

An 8GB VRAM RTX 5060 Ti with 16GB RAM now serves as a local image-generation machine. The workflow compresses the model to about 12GB, generates a small image first, upscales at 2x, and runs one image at a time. That keeps memory usage under control and produces a 1792×2304 vertical image in roughly 30 seconds at 8 steps.

Three evenings of testing overturned three assumptions. Measured texture and brightness pointed to flat lighting as the cause of the fake look, not over-smoothed skin. 4x upscaling turned skin into sandpaper, so 2x is the ceiling. Negative prompts like 'don't include xx' were read and ignored, so the workflow avoids risky subjects instead of forbidding them. Lighting prompts need direction, bright areas, and shadows spelled out; a single word like 'backlight' produces flat front light.

The same seed plus the same person description keeps the same face across different clothes, backgrounds, and scenes, which turns the site into a way to shoot one person anywhere. Ten built-in subjects, three aspect ratios, and two portrait texture modes are available, and the page runs in a browser on a phone. Changing one word at a time is the habit that makes the loop work: alter one word, see what it does, repeat.

Takeaways
— On an 8GB VRAM RTX 5060 Ti with 16GB RAM, a compressed model, small-then-upscale generation, and single-image runs keep memory usage under control.
— Compressing the model from tens of GB to about 12GB and using an 8-step fast version cuts generation time to about 30 seconds, at the cost of higher sensitivity to prompt wording.
— The first night logged 6 out-of-memory failures; the fix was model compression, generating small before upscaling, and running one image at a time.
— A portrait judged 'fake' measured 3.10 texture intensity and 147 average brightness, while an accepted one measured 4.84 and 127; the visible difference was flat light, not smooth skin.
— 4x upscaling made skin look like sandpaper; 2x upscaling in one pass is the working choice.
— Negative prompts such as 'don't include xx' and 'forbidden: xx' were ignored by the model; avoiding error-prone subjects works better than forbidding them.
— Lighting prompts need three components: source direction, bright areas, and shadows. A single word like 'backlight' produced flat front light.
— Same seed plus same person description keeps the same face when clothes, background, or scene change; changing the seed or person description produces a different person.
— The site has ten built-in subjects, three aspect ratios, and two portrait texture modes, and works from a phone browser without installation.
— Changing one word at a time when something looks wrong is the habit that makes iterative prompting controllable.
Conclusions

Measuring texture intensity and brightness turned a vague 'looks fake' complaint into two numbers, and the brightness gap pointed at flat lighting rather than over-smoothing. A quick measurement beats another round of guessing.

Compressed fast models amplify prompt errors: they guess, so a 4x upscale makes both correct and incorrect guesses equally sharp. The practical ceiling is the model's confidence; the upscale factor only exposes it.

A shorter feedback loop is the biggest speedup from AI coding: half-hour rounds became one-minute rounds, so a human can run hundreds of visual experiments in a single evening.

Seed-based identity control turns image generation into a usable photography workflow: one face can be moved across scenes and outfits without redrawing the person.

Concepts & terms
seed
A number that acts as an image ID. The same prompt plus the same seed produces nearly the same image; changing the seed produces a different image, and with a fixed person description it produces a different person.
steps
The number of refinement rounds a diffusion model runs while turning noise into an image. More steps usually mean more detail; the compressed fast model in this build uses 8 steps instead of the conventional dozens.
negative prompt
Text that tells an image model what not to include, such as 'don't show xx'. The model in this build read negative instructions and ignored them, so the workflow avoids unwanted subjects instead of forbidding them.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗