根据文字、参考图、公网图片 URL 或本地照片制作可直接打印裁剪的证件照。只要用户提到证件照、报名照、护照照、白底/蓝底/红底换底、1寸/2寸、证件照排版、证件照打印、或想把普通照片变成证件照,都应使用这个 skill。默认优先处理用户已有照片;只有缺图或用户明确要求时,才调用 Liblib 的文生图或图生图。
把证件照制作变成稳定、可重复的执行流程:先判断输入来源,再收集缺失参数,然后按需走 Liblib 生图或本地照片处理,最后输出可直接打印裁剪的静态排版页。
A4 和 6寸 两种打印页。必须收集:
按需收集:
AccessKey / SecretKey.env.local如果缺少这些信息,主动追问。优先一问一答,不要一口气抛太多问题。
文字描述,没有现成照片
scripts/generate_via_liblib.py text2img ...scripts/process_local_photo.py ...scripts/render_print_sheet.py ...本地照片
scripts/process_local_photo.py ...scripts/render_print_sheet.py ...公网图片 URL
sourceImage 传给 Liblib,成功后再做后处理和排版。prompt 使用纯英文。clean studio lightingfront-facing personrealistic faceformal ID photocentered compositionplain backgroundhigh detailno watermarkcontrolType: depth | pose | line | IPAdaptercontrolImage: <public URL>~/.copilot/skills/id-photo-maker/.env.localAccessKey 与 SecretKeyLIBLIB_ACCESS_KEY=... / LIBLIB_SECRET_KEY=... 的形式写入 .env.localSecretKey。如果 skill 目录有 .venv/bin/python,优先用它;否则用 python3。
python3 ~/.copilot/skills/id-photo-maker/scripts/generate_via_liblib.py \
text2img \
--prompt "front-facing young woman, formal chinese id photo, clean studio light, realistic face, centered composition, plain background, high detail, no watermark" \
--aspect-ratio portrait \
--output-dir /tmp/id-photo-run/generated
python3 ~/.copilot/skills/id-photo-maker/scripts/generate_via_liblib.py \
img2img \
--prompt "formal id photo, realistic face, centered composition, clean studio light, no watermark" \
--source-image-url "https://example.com/reference.png" \
--output-dir /tmp/id-photo-run/generated
python3 ~/.copilot/skills/id-photo-maker/scripts/process_local_photo.py \
/tmp/id-photo-run/generated/liblib-1.png \
--size 1寸 \
--background white \
--framing standard \
--output-dir /tmp/id-photo-run/processed
python3 ~/.copilot/skills/id-photo-maker/scripts/render_print_sheet.py \
--photo /tmp/id-photo-run/processed/id-photo.png \
--size 1寸 \
--pages a4,6inch \
--output-dir /tmp/id-photo-run/print
默认交付:
id-photo.png:标准尺寸成片metadata.json:尺寸、背景、构图、来源与导出信息print-a4.htmlprint-6inch.htmlindex.html:打印页入口scripts/id_photo_common.py - shared size presets, color parsing, and download helpersscripts/credential_store.py - .env.local credential read/writescripts/liblib_client.py - Liblib API signing, request, polling, and downloadscripts/generate_via_liblib.py - CLI for text2img / img2imgscripts/process_local_photo.py - local / URL photo processing, background replacement, and exportscripts/render_print_sheet.py - A4 / 6寸 printable HTML sheet generationreferences/size-presets.md - supported presets and physical dimensionsreferences/workflow-rules.md - routing, prompt, and questioning rulesreferences/liblib-auth.md - AK/SK signing model and request rulesassets/print.css - print-safe stylesheetrequirements.txt - Python dependencies