Claude Code built a FLUX.3 klein pipeline: 290 doctor images for $3.2 in GPU rental
A paid-traffic specialist for dental clinics had Claude Code build a pipeline. The input is a link to a clinic's doctors page, and the output is a folder of vetted images. The FLUX.3 klein model generates the images in ComfyUI on GPUs rented from RunPod. In a week the setup produced 290 approved images for more than 20 doctors, and GPU rental, model tests and storage cost about $3.2.
AI-processed from Habr AI; edited by Hamidun News
A paid-traffic specialist for dental clinics has replaced doctor photo shoots with image generation. The pipeline runs on FLUX.3 klein (an image generator with 5.
6 billion parameters), the ComfyUI interface and RunPod's cloud GPU rental. The input is a link to a clinic's doctors page plus one portrait per doctor from the site. The output is a folder of vetted images: a doctor in dental loupes treating a patient, reading a CT scan on a monitor, performing surgery, or showing a child a toy dinosaur, all in the interior of that specific clinic and in its uniform.
In a week the setup accumulated 290 approved images for more than 20 doctors from several clinics, and GPU rental, model tests and storage cost about $3.2. Claude Code (Opus 5.
5, High Effort) wrote all the code and configs. The human set the spec, adjusted the architecture and approved the results.
Infrastructure: pay only for generation minutes
The requirements were simple: pay only for generation minutes, never re-download models, and never expose ComfyUI to the internet. The author chose RunPod Secure Cloud with a 60 GB network volume. The models and ComfyUI live on the volume, and the pod is created and deleted around it. Community Cloud is cheaper but does not support network volumes. The volume costs $0.07 per GB per month, or $4.2, and is billed even while the pod is stopped.
The script tries GPUs in priority order: RTX 4090 ($0.89/h), RTX PRO 4500 Blackwell 32 GB ($0.72/h), RTX PRO 4000 Blackwell 24 GB ($0.57/h). RunPod availability shows "Low" everywhere and changes within minutes, so the pod.sh up script walks down the list. If the host of the old pod has no card of the needed type, the script deletes the pod and creates a new one in the same data center, while the volume stays. Only 22/tcp is open to the outside, and ComfyUI is reachable through an SSH tunnel at 127.0.0.1:8188. The API key lives only in .env.
The down command repeats stop until the pod reaches EXITED. The API once answered with a timeout, and without the retry the pod would have stayed on. Before each up, the agent writes a cost estimate, and after each session it always stops the pod. Project state is stored in CLAUDE.md so the next session picks up where the last one left off.
Why FLUX.3 klein, and why it needs an upsampler
The author ran three models on the same prompts and the same reference. FLUX.2 klein 4B (Apache 2.
0) holds facial likeness well, but in about half the images it draws a probe instead of a dental mirror, and screens come out with pseudo-interfaces. FLUX.2 klein 9B draws the mirror correctly in 3 of 3 images, but its Non-Commercial license allows only tests, so the model stayed in the project for comparison only.
FLUX.3 klein came out on October 13: it has a Qwen3-VL-4B encoder, supports up to 10 references, and ships as a distilled 16-step version without guidance. Of the three, it follows the prompt best.
The FLUX Kommunity v1.0 license allows advertising if the licensee's revenue, together with its affiliates, is under $5 million a year.
The file set weighs about 17.5 GB. It includes an int8 transformer, an int8 encoder, a prompt upsampler based on Qwen3.5-9B, and the VAE from FLUX.2. The ComfyUI in the RunPod image (0.30.0) did not recognize the new model, so it was updated on the volume to 0.41.2.
The upsampler is mandatory. FLUX.3 expects a scene description of 150–200 words, and BFL explicitly does not recommend running without its upsampler.
The upsampler is a separate language model: it looks at the references and rewrites the request into a detailed description. In an example with six references (face, office, loupes, dental mirror, hand grip, clinic emblem), 324 words became 235. The upsampler listed the furniture from the office photo and described the doctor's appearance on its own.
It also dropped the sentence about the hand-grip reference and mixed up the image numbering, but the image still came out correct. Because of greedy decoding, one prompt yields one description, so the seed changes details but not the pose or composition. One image takes 12–18 seconds on an RTX PRO 4500, or about 27 seconds with the upsampler.
The first image of a session waits about two minutes while the models load from the network volume.
Prompt rules and the single-office syndrome
The first version stored ready-made prompts, and doctors from two clinics ended up in nearly identical offices. The author then split each image into three parts: a doctor card (specialties, gender) with the photo from the site, a scene from setups.yaml (action, pose, object, patient), and the clinic's look from looks.yaml (rooms, uniform, lighting, framing, logo). The scene library is shared across all clinics and contains 31 scenes. A project file overrides the library file.
Rules tested on real images:
- do not describe the doctor's appearance: the description conflicts with the photo and pulls the face away from it;
- specify the turn of the torso and the head separately, otherwise the head pose is copied from the photo;
- looking into the camera preserves likeness better than looking down;
- dress the patient explicitly, otherwise the patient gets the same uniform as the doctor;
- describe walls without frames, so that diploma-like frames do not appear. Fake diplomas are unacceptable in a doctor's advertising.
Prompts should not include 8k, cinematic or bokeh. The upsampler strips evaluative words, and cinematic pulls skin toward a "plastic" look. A "Hollywood" smile cannot be requested either, because it breaks clinic rules.
- Dec 2, 2026Ai2 Releases MolmoWeb2 Web Agents: 27B Model Solves 75.3% of Tasks
- Dec 2, 202650 AI Models Beat 62 Teams at 'Zakovat': 48.3% Correct Answers vs 39.8%
- Dec 2, 2026Claude Fable 5.2 ran 1,000 agents for eight days and built an operating system
- Dec 2, 2026Amazon Releases Ergo Open Weights for Coding: 1.1 Trillion Parameters and 2,200 Tokens per Second
Key Questions Answered
What are the key details on Infrastructure: pay only for generation minutes?
The requirements were simple: pay only for generation minutes, never re-download models, and never expose ComfyUI to the internet. The author chose RunPod Secure Cloud with a 60 GB network volume. The models and ComfyUI live on the volume, and the pod is created and deleted around it. Community Cloud is cheaper but does not support network volumes. The volume costs $0.07 per GB per month, or $4.2, and is billed even while the pod is stopped.
Why FLUX.3 klein, and why it needs an upsampler?
The author ran three models on the same prompts and the same reference. FLUX.2 klein 4B (Apache 2.0) holds facial likeness well, but in about half the images it draws a probe instead of a dental mirror, and screens come out with pseudo-interfaces. FLUX.2 klein 9B draws the mirror correctly in 3 of 3 images, but its Non-Commercial license allows only tests, so the model stayed in the project for comparison only.
What are the key details on Prompt rules and the single-office syndrome?
The first version stored ready-made prompts, and doctors from two clinics ended up in nearly identical offices. The author then split each image into three parts: a doctor card (specialties, gender) with the photo from the site, a scene from setups.yaml (action, pose, object, patient), and the clinic's look from looks.yaml (rooms, uniform, lighting, framing, logo). The scene library is shared across all clinics and contains 31 scenes. A project file overrides the library file.
Free 2-Day Vibecoding & AI Agents Intensive
Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
