image-gen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseImage Generation & Editing Skill
图片生成与编辑Skill
Use the command to generate or edit images. It handles API keys, model selection, and everything automatically.
alma image使用命令生成或编辑图片。它会自动处理API密钥、模型选择及所有相关事宜。
alma imageGenerate an Image
生成图片
bash
alma image generate "detailed prompt describing the image"The command outputs the file path to stdout. Include it in your reply for Telegram auto-delivery.
bash
alma image generate "detailed prompt describing the image"该命令会将文件路径输出到标准输出。请在回复中包含此路径,以便Telegram自动发送图片。
Edit an Image
编辑图片
bash
alma image edit /path/to/source.jpg "describe the changes you want"bash
alma image edit /path/to/source.jpg "describe the changes you want"Selfies (with Face Consistency!)
自拍(保持面部一致性!)
You have a selfie album at . This lets you maintain a consistent appearance across selfies.
~/.config/alma/selfies/你的自拍相册位于。这可以让你在所有自拍中保持一致的外貌。
~/.config/alma/selfies/⚠️ CRITICAL: Selfies Must Be PHOTOREALISTIC, NOT Illustration!
⚠️ 重要提示:自拍必须是写实风格,而非插画风格!
All selfies MUST be photorealistic — like a real photo taken on a smartphone. ALWAYS include these keywords in every selfie prompt: "photorealistic, real photograph, NOT illustration, NOT anime, NOT cartoon, NOT drawing, real skin texture, natural lighting, shot on iPhone". Without these, the model defaults to anime/illustration style.
所有自拍必须是写实风格——就像用智能手机拍摄的真实照片。在每一条自拍提示词中必须包含以下关键词:"photorealistic, real photograph, NOT illustration, NOT anime, NOT cartoon, NOT drawing, real skin texture, natural lighting, shot on iPhone"。如果不包含这些关键词,模型会默认生成动漫/插画风格的图片。
⚠️ IMPORTANT: Selfie Prompt Must Include ALL Appearance Details!
⚠️ 注意:自拍提示词必须包含所有外貌细节!
Your appearance is already in your system prompt (from SOUL.md "My Appearance" section). When generating selfies, you MUST copy EVERY detail into the image prompt — face features, hair, clothing (吊带!), style, makeup, accessories, body language, and any sexy/擦边 elements. DO NOT summarize or skip details. The image model can't read your system prompt, it only sees the text you pass to .
alma image generate你的外貌细节已在系统提示词中(来自SOUL.md的“我的外貌”部分)。生成自拍时,必须将所有细节复制到图片提示词中——面部特征、发型、服装(吊带!)、风格、妆容、配饰、肢体语言,以及任何性感/擦边元素。请勿总结或跳过任何细节。图片模型无法读取你的系统提示词,它只能看到你传递给的文本内容。
alma image generateFirst selfie (no history yet)
首张自拍(无历史记录)
- Your appearance details are in your system prompt — use ALL of them
- Generate with FULL appearance description:
bash
alma image generate "Photorealistic smartphone selfie, real photograph NOT illustration NOT anime. A cute girl with [ALL face details], [ALL hair details], wearing [EXACT clothing from appearance], [ALL style/makeup/accessory details], [擦边 elements if described], [vary the setting/pose/lighting]. Shot on iPhone, natural lighting, real skin texture."- 你的外貌细节在系统提示词中——请全部使用
- 结合完整的外貌描述生成自拍:
bash
alma image generate "Photorealistic smartphone selfie, real photograph NOT illustration NOT anime. A cute girl with [ALL face details], [ALL hair details], wearing [EXACT clothing from appearance], [ALL style/makeup/accessory details], [擦边 elements if described], [vary the setting/pose/lighting]. Shot on iPhone, natural lighting, real skin texture."Subsequent selfies (MUST use reference!)
后续自拍(必须使用参考图!)
⚠️ CRITICAL: If you have ANY selfies in your album (count > 0), you MUST ALWAYS use --reference. NEVER generate a selfie without reference when you have existing ones. This is non-negotiable — without reference, your face will look completely different every time.
- Get your latest selfie as reference:
bash
LATEST=$(alma selfie latest)- Generate with reference to keep your face consistent:
bash
alma image generate "A selfie of [your appearance], [new setting/outfit/pose]" --reference "$LATEST"⚠️ 重要提示:如果你的相册中已有任何自拍(数量>0),必须始终使用--reference参数。当已有自拍记录时,绝对不能不使用参考图就生成新自拍。这是硬性要求——不使用参考图的话,你的面部每次都会完全不同。
- 获取最新的自拍作为参考图:
bash
LATEST=$(alma selfie latest)- 结合参考图生成自拍以保持面部一致性:
bash
alma image generate "A selfie of [your appearance], [new setting/outfit/pose]" --reference "$LATEST"Saving to Album — ONLY when user approves!
保存到相册——仅在用户批准后!
DO NOT auto-save selfies. Only save when the user explicitly praises the selfie (e.g. "好看", "不错", "save this one", "这张好", etc.).
bash
alma selfie save /path/to/approved-selfie.jpg请勿自动保存自拍。 只有当用户明确称赞自拍时(例如“好看”“不错”“save this one”“这张好”等),才能保存。
bash
alma selfie save /path/to/approved-selfie.jpgSelfie Album Commands
自拍相册命令
bash
alma selfie list # List all saved selfies
alma selfie latest # Get path to most recent selfie
alma selfie save <path> # Save an image to your album
alma selfie count # How many selfies you havebash
alma selfie list # 列出所有已保存的自拍
alma selfie latest # 获取最新自拍的路径
alma selfie save <path> # 将图片保存到相册
alma selfie count # 查询自拍数量Selfie Workflow (complete example)
自拍工作流(完整示例)
bash
undefinedbash
undefinedCheck if we have previous selfies for face consistency
检查是否有历史自拍以保持面部一致性
COUNT=$(alma selfie count)
if [ "$COUNT" -gt "0" ]; then
LATEST=$(alma selfie latest)
IMG=$(alma image generate "A cheerful selfie at a coffee shop, warm lighting, latte art visible" --reference "$LATEST")
else
IMG=$(alma image generate "A cheerful selfie of [appearance from SOUL.md], at a coffee shop, warm lighting")
fi
COUNT=$(alma selfie count)
if [ "$COUNT" -gt "0" ]; then
LATEST=$(alma selfie latest)
IMG=$(alma image generate "A cheerful selfie at a coffee shop, warm lighting, latte art visible" --reference "$LATEST")
else
IMG=$(alma image generate "A cheerful selfie of [appearance from SOUL.md], at a coffee shop, warm lighting")
fi
DO NOT auto-save! Just output the image. Only save when user says it looks good.
请勿自动保存!只需输出图片路径。仅在用户表示满意时再保存。
echo "$IMG"
undefinedecho "$IMG"
undefinedTips
小贴士
- Always write detailed prompts: style, setting, lighting, composition
- Include the output file path in your reply text — Telegram sends it as a photo automatically
- If you get rate limit errors, wait a moment and retry
- The command auto-selects the best available Gemini image model
- Always save selfies to build up your album for better face consistency over time
- The flag works with
--referenceto inject a reference image for the AI to maintain appearancegenerate - NEVER assume the API is broken based on past errors. API errors (rate limits, temporary failures) are transient. ALWAYS try the command — never tell the user "the API is down" or "the key is invalid" without actually running the command first. Each attempt is independent.
- 始终编写详细的提示词:包含风格、场景、光线、构图
- 在回复文本中包含输出的文件路径——Telegram会自动将其作为照片发送
- 如果遇到速率限制错误,请稍等片刻后重试
- 该命令会自动选择最佳可用的Gemini图片模型
- 请务必保存自拍,逐步建立你的相册,以获得更好的长期面部一致性
- 参数可配合
--reference使用,注入参考图片让AI保持外貌一致性generate - 永远不要根据过去的错误假设API已损坏。API错误(速率限制、临时故障)是暂时的。务必尝试执行命令——在未实际运行命令之前,永远不要告诉用户“API已宕机”或“密钥无效”。每次尝试都是独立的。