A Drink, A Tiny Store
Upload a real coffee/milk tea photo → get a delicate, brand-themed isometric store illustration, plus a high-resolution "Original vs Illustration" comparison image.
Core Principle (Just One Sentence): Preserve the identifying features of the original drink; redesign its architectural function. It's not "draw a similar cup," but "let that drink in the photo grow windows, stairs, and a little shopkeeper."
What the Final Product Looks Like
Take the GridCoffee green cup as an example: the green cup body becomes the main two-story structure, the milky white lid becomes the roof terrace, the white square logo remains on the wall as-is; arched windows and striped awnings are cut into the cup body, with a wooden staircase and greenery on the right, a mascot, small tables and chairs, and an A-frame sign out front; the entire building sits on a diagonal stone platform; the top has a rounded bold title Grid Coffee / Americano / Yunnan · Giupo Estate, on a mint green solid background with white clouds.
The style is a 2D vector illustration made in Adobe Illustrator, not a 3D scene rendered in Blender.
Workflow (Runs Automatically, No Step-by-Step Confirmation)
By default, the user uploads a drink photo, often with additional notes like brand name, drink name, coffee bean origin, or collaboration. Follow these six steps in one go.
Step 0 · Receive Image & Preprocess
PY="$HOME/.workbuddy/binaries/python/envs/default/Scripts/python.exe"
[ -x "$PY" ] || PY="$(command -v python || command -v python3)"
SK="$HOME/.workbuddy/skills/cup-shop-illustration/scripts/imgtool.py"
OUT="<current workspace>/out/cup-shop-illustration"
mkdir -p "$OUT"
"$PY" "$SK" prepare "<absolute path of user uploaded photo>" --out "$OUT/photo_clean.jpg"
prepareunifies EXIF orientation, converts to sRGB, removes alpha, resizes so longest edge ≤ 2048, and prints an info card (width, height, orientation, brightness, dominant colors). The orientation in the info card determines the canvas ratio and stiching direction later.- It only changes the file format and size, it does not alter the image content. Use
photo_clean.jpgfor feeding ImageGen; use the original photo uploaded by the user for stitching. - If the user uploads a format Pillow cannot read (e.g., HEIC / webp), convert it to PNG using system tools first, then run this step, and inform the user accordingly.
Step 1 · Observe the Photo, Fill the "Diagnosis Card"
Use visual capability to look at the original photo directly (do not use code to extract edges, do not generate a line art preemptively), and read the diagnosis card in references/diagnose.md item by item:
| Field | Content |
|---|---|
| Brand Name | Logo/text on the cup, prefer English name or pinyin if possible |
| Drink Name | Read from the cup label, receipt, or user's description |
| Cup Type | Takeaway paper cup / transparent plastic cup / can / glass bottle, and width-to-height ratio |
| Top Structure | Flat lid, drinking spout, straw, cream cap, whipped cream, seal |
| Main Color / Secondary Colors | Cross-validate with dominant color info card from Step 0 |
| Logo & Text | Shape, position, color (example: white hollow square + GridCoffee below cup body) |
| Toppings / Decorations | Coffee beans, pearls, fruit, cookie crumbs, layers, ice cubes |
| Origin / Collaboration | Yunnan estate, collaboration IP, etc., which can be turned into environmental elements |
Rule: Information explicitly provided by the user takes precedence; anything unreadable from the photo must not be fabricated; instead, use descriptions like "original text/graphics on the cup body"; do not arbitrarily change the brand, colors, or cup type.
Step 2 · Assemble the Prompt
Read references/prompt-master.md, use the main template to fill in the 6 slots (brand / drink / additional instructions / canvas ratio determined by original image orientation / background color / special elements), and get a complete prompt.
- The style clauses, negative words, and composition constraints in the template are preserved as-is, do not simplify them.
- The final generated prompt is a core asset; include it verbatim in the delivery (users often want to reuse it).
- When Chinese text plaques are needed, the main title should still be in English; Chinese should only be used for small decorative elements; AI Chinese is prone to garbled characters, see
diagnose.mdfor handling.
Step 3 · Generate Image (ImageGen Image-to-Image)
⚠️ Before calling, clearly inform in the reply: a single ImageGen call consumes approximately 5–10 credits. Declare first, then call.
| Parameter | Value |
|---|---|
prompt | Complete prompt from Step 2 |
image1 | Absolute path of photo_clean.jpg from Step 0 (real photo, text-to-image only is prohibited) |
size | Portrait: 1024x1365 (3:4, tested viable on 2026-11-08, actual return is 1024x1360; if rejected, fallback to 1024x1280); Landscape: 1536x1024; Square: 1024x1024 |
quality | high |
input_fidelity | medium (default, see parameter tuning below) |
output_dir | $OUT |
footnote | "" (tool-side watermark can be removed; the platform will still forcibly overlay "AI Generated WORKBUDDY", use Step 5's cleanwm to remove) |
style | Leave empty, style is locked by the prompt |
input_fidelity Parameter Tuning: medium preserves cup shape/logo/colors while allowing recomposition. If it drifts to "another cup" → increase to high; if the image looks like a photo trace and the perspective hasn't become 45° → decrease to low.
The generated output is a single, standalone, complete illustration. Never let AI directly draw a left-right comparison image, and never crop an illustration from a comparison image.
Step 4 · Self-Check
Compare against the nine self-check items in references/diagnose.md. Three must-check items:
- Can one immediately recognize it as the drink in the photo? (Cup shape, main color, logo position)
- Is it pure 2D bold black outlines + solid flat colors? (Presence of plastic texture / gradients / soft shadows = failure)
- Are the building, stairs, characters, platform, and title all fully within the frame? (Cropping = failure)
If unqualified → modify only the corresponding part of the prompt, retry at most once; if still unqualified, deliver it as-is and explain possible directions for adjustment, do not disguise as a success.
Step 5 · Remove Watermark + Code Stitching
The platform will forcibly overlay "AI Generated WORKBUDDY" white text on the bottom right of the illustration, footnote: "" cannot remove it. First remove it cleanly, then stitch:
"$PY" "$SK" cleanwm "$OUT/<illustration filename>.png" --out "$OUT/<original name>_illustration.png"
"$PY" "$SK" compose \
--photo "<absolute path of user's original photo>" \
--art "$OUT/<original name>_illustration.png" \
--out "$OUT/<original name>_compare.png"
cleanwm's defaultselectivemode only pulls whitish watermark pixels toward the background color, does not crop the platform, does not accidentally erase green leaves, tested to be residue-free and seamless. Default--threshold 160; if there are light-colored decorations like white clouds or white stone tiles in the bottom right, raise it to190–210to avoid false hits. If the watermark is in a special position, adjust--box "x0,y0,x1,y1", or switch to--mode fill(this will erase decorations within the box, use with caution).composeautomatically selects layout based on original image orientation: portrait/square → original on left, illustration on right; landscape → original on top, illustration on bottom. You can also use--layout side|stackto force a layout.- Uses the illustration's original pixels as the base, the illustration is not scaled, the original photo is proportionally scaled to align; white gap 24px, outer margin 24px, ratio differences are absorbed by the white space.
- No cropping, no stretching, no modifying the original photo content, outputs a high-resolution PNG.
- If
cleanwmfails, fallback:trim <illustration> --bottom 0.06 --mode pad; but it will crop the bottom of the image, potentially cutting into the platform. Use only as a last resort.
Step 6 · Deliver
Use present_files to first show the comparison image, then the standalone illustration (both must be provided). In the reply, give a three-line conclusion: identified brand/drink, canvas ratio and input_fidelity, paths to the two files; then attach the complete original prompt.
Hard Rules (Violation = Failure)
- Must use a real photo as
image1for image-to-image generation, cannot redraw a cup based only on text. - Stitching must use the user's uploaded original photo, cannot impersonate with an AI redrawn "photo."
- Preserve the original cup shape, main color, logo, and packaging features; what is redesigned is the architectural function, not the packaging.
- Do not mechanically replicate the original photo's shooting angle; perform a reasonable 3D spatial extrapolation (45° isometric view from above).
- First generate a standalone complete illustration, then stitch; cropping from a comparison image is prohibited.
- Only 2D vector illustrations, strictly no 3D rendering / realism / watercolor / gradients / complex lighting.
- Do not use code to extract edges or generate line art; let the image model directly understand the original image.
- Must inform credit consumption before generating; do not request step-by-step confirmation, run all at once.
Adjustable Parameters
| What to Change | Where to Adjust |
|---|---|
| Background color | Prompt "bright soft mint green" → change to brand-coordinated color |
| Title text | Main/subtitle slots; if unsure, use only brand name |
| Origin / Collaboration elements | "Special elements" slot, e.g., coffee branches, estate A-frame sign, collaboration figurine |
| Number of mascots / stairs vs slide | "Architectural design" section in prompt, facility list |
| Canvas ratio | size in Step 3, also update the canvas clause in the prompt |
| Fidelity | input_fidelity low / medium / high |
| Stitch gap and background color | compose --gap --pad --bg |
Resources
| File | Purpose |
|---|---|
references/prompt-master.md | Main: complete reusable prompt template, slot table, three filled examples, negative word list |
references/diagnose.md | Photo diagnosis card, nine self-check items, failure fix table, Chinese text handling |
scripts/imgtool.py | Five local subcommands: prepare / cleanwm / compose / trim / sheet |
README.md | Chinese installation and usage instructions |