l-make-product-photo
Create product photos with background removal and standardized formatting. Use when: (1) User says '/l-make-product-photo' or 'make product photo', (2) User wants to create product photos, remove back...
Make Product Photo
Create standardized product photos from source images using ML-based background removal.
What It Does
- Removes the background from product images using ML-based detection
- Creates a 1600x1600 square JPEG with:
- Default background: fabric texture image (bundled at
assets/default-bg.jpg) - Override with
--with-bg <path>for a different background - Product centered in a 90% container (1440x1440 area)
- Product fitted like CSS
object-fit: contain
- Default background: fabric texture image (bundled at
- Outputs to
__inbox/prod-imgs-exported/by default
Usage
node ./sub-packages/product-photo-maker/bin/make-product-photo.mjs <image-path> [<image-path-2> ...] [--output <dir>]
Examples
Single image:
node ./sub-packages/product-photo-maker/bin/make-product-photo.mjs ./imgs/my-product.heic
Multiple images:
node ./sub-packages/product-photo-maker/bin/make-product-photo.mjs ./imgs/photo1.jpg ./imgs/photo2.png ./imgs/photo3.heic
Custom output directory:
node ./sub-packages/product-photo-maker/bin/make-product-photo.mjs ./imgs/photo.jpg --output ./my-output-dir
Options
| Option | Short | Description |
|---|---|---|
--output <dir> | -o | Override output directory (default: __inbox/prod-imgs-exported/) |
--with-bg <path> | Use a custom background image instead of the default fabric texture | |
--no-bg-removal | Skip background removal entirely (use image as-is) | |
--no-trim | Skip trimming after bg removal | |
--shadow | Add directional shadow (grounded, upper-left light) | |
--float | Use floating shadow (for modular synth panels; requires --shadow) |
When NOT to use this skill
Skip this skill entirely when the source is an already-taken final studio photo — top-down,
on the Takazudo orange fabric, properly framed, panels/parts where you want them. The photo is
already “taken”; the only step needed is /l-orange-tweak for tone normalization, then drop the
file into /imgs/.
Synthesizing shadow on a flat top-down photo darkens the corners with a fake vignette instead of producing depth — the image looks worse, not better. The shadow stack here was built for the “incoming photo / bg-removed composite” path: take a non-orange or stock manufacturer photo, remove the background, composite onto orange fabric, then synthesize lighting + shadow. That synthesis makes a panel-cutout look like a real photo. Applying the same synthesis to a real photo is double-application.
Decision: Was this photo already taken (top-down, on the orange fabric, framed and lit)?
- Yes → skip this skill. Run
/l-orange-tweakonly, then/imgs/→/l-metadata-update. - No, it needs synthesis → continue below.
Deciding flags per image
When the user provides images, look at each image to decide which flags are needed. Since flags apply to all images in a single run, group images by mode and run the command separately for each group.
--no-bg-removal (skip background removal)
Use when the image IS the product with no background — the product fills the entire frame edge-to-edge. Background removal would damage the product colors (especially dark/black products where the ML model confuses the product with background).
--no-trim (skip trimming)
Use when background removal is needed but the product already fills most of the frame. Trimming could over-crop the product.
Default (no flags)
Use when the image has a clear, visible background (white, gray, colored, studio backdrop, etc.) surrounding the product. Background removal extracts the product, trimming removes leftover transparent space so the product fills the container.
Decision flow
- Product fills entire frame, no background visible →
--no-bg-removal - Product on a background, product fills most of the frame →
--no-trim - Product on a background with significant space around it → default (no flags)
Shadow decision (--shadow and --float)
Once you’ve decided this skill should run at all (i.e., the photo needs synthesis — see “When NOT
to use this skill” above), add --shadow and decide float vs grounded:
- Modular synth panels (Eurorack modules with visible panel edges, jacks, knobs on a flat faceplate) →
--shadow --float(panel hovers above surface) - Desktop/standalone products (MIDI controllers, desktop units, boxes that sit flat) →
--shadowonly (grounded shadow)
AI detection hint: Modular synth panels are typically tall-narrow rectangles (3
to 5 aspect ratio or wider) with a visible metal/aluminum faceplate, rows of 3.5mm jacks, and Eurorack-style knobs. Desktop products are wider/squarer and sit on a surface.When unsure, ask the user: “Is this a modular synth panel (floating) or a desktop product (grounded)?” to decide --float.
Notes
- Accepts jpg, png, webp, heic and other common image formats
- Output filename matches input filename with
.jpgextension - First run downloads the ML model (~30MB), subsequent runs are faster
- If dependencies are not installed, run:
cd sub-packages/product-photo-maker && pnpm install - Output directory is created automatically if it does not exist
Workflow Integration
After creating product photos, you may want to:
- Move images to
/imgs/for the image pipeline - Run
/l-metadata-updateto process and upload to R2 - Reference the images in product master data or MDX content