去中心化 AI 图像视频生成引擎
简介
基于 Sogni AI 去中心化 GPU 网络的图像与视频生成工具,支持文生图、图生视频、人脸风格迁移及 360° 环物视频,为创作者提供高性价比的 AI 媒体生产能力。
原始描述
Generate images **and videos** using Sogni AI's decentralized network, with local credential/config files and optional local media inputs. Ask the agent to "...
通过你的 Agent 添加
安装目录:sogni-gen/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
sogni-gen 是一款面向 Claude Code / Claude Desktop 用户的 AI 媒体生成技能,通过调用 Sogni AI 的去中心化 GPU 网络实现图像与视频生成。用户可通过自然语言指令(如 "draw"、"generate"、"make a video")触发生成任务,支持多种工作模式:
图像生成:基础文生图(z_image_turbo_bf16 等模型)、图生图编辑(Qwen 系列支持最多 3 张参考图)、Photobooth 人脸风格迁移(InstantID + SDXL Turbo)。
视频生成:文生视频(t2v)、图生视频(i2v)、音生视频(s2v)、动作迁移(animate-move/replace),以及独特的 360° 环物视频合成(需本地 ffmpeg)。
高级功能:首尾帧插值动画、多视角 LoRA 控制(方位角/仰角/距离)、种子策略管理(prompt-hash 确定性生成)、SPARK/SOGNI 代币余额查询。
配置通过 ~/.config/sogni/credentials 存储凭据,支持 ~/.openclaw/openclaw.json 进行默认参数覆盖,CLI 标志始终优先。
显著优点
-
模型丰富度:覆盖从极速迭代(Flux Schnell 4 步)到高质量输出(Flux2 Dev)的全谱系图像模型,视频端基于 Wan 2.2 14B 的多种工作流适配不同创意需求。
-
专业级工作流:360° 环物视频、Photobooth 人脸迁移、照片修复等垂直场景功能完整,参数粒度精细(ControlNet 强度、LoRA 叠加、采样器/调度器覆盖)。
-
生态集成:原生支持 MCP 协议、OpenClaw 插件体系,JSON 输出便于脚本化,与 Claude 等 Agent 环境无缝衔接。
-
成本效率:基于代币经济(Spark/Sogni),512x512 图像性价比最优,每日 50 免费 Spark 点降低试用门槛。
-
确定性生成:prompt-hash 种子策略确保相同提示词输出一致结果,利于迭代优化。
潜在缺点与局限性
-
外部依赖重:必须注册 Sogni AI 账号并配置凭据,所有生成任务依赖 Sogni 网络可用性,离线场景完全不可用。
-
视频尺寸约束:i2v 视频要求宽高 16 像素整除,且参考图缩放后尺寸可能因取整导致请求参数失效,需理解自动调整机制或手动使用 --strict-size。
-
ffmpeg 可选依赖:360 视频合成功能需要本地安装 ffmpeg,跨平台配置增加复杂度。
-
T3 来源风险:虽代码质量达标,但由个人开发者维护,长期维护承诺与官方背书弱于 T1/T2 来源。
-
网络与超时:视频生成默认 300 秒超时,复杂任务可能因网络波动或算力排队失败。
适合的目标群体
- AI 辅助创作者:需要快速生成概念图、风格参考、短视频素材的设计师与艺术家。
- 电商/产品运营:利用 360° 环物视频、Photobooth 生成商品展示与模特图。
- Claude 生态用户:已在 Claude Code/Desktop 环境中工作,希望直接通过对话触发媒体生成。
- 开发者与自动化需求:需要 JSON 接口、MCP 服务器集成,将 AI 生成嵌入工作流。
- 成本敏感型用户:相比 Midjourney、Runway 等订阅制服务,代币按需付费模式更灵活。
使用风险
- 凭据泄露风险:
~/.config/sogni/credentials 文件权限需严格设置为 600,共享环境或备份时易疏忽。
- 输出覆盖风险:
-o 参数直接写入指定路径,无二次确认,可能意外覆盖重要文件。
- 代币耗尽风险:批量生成或高分辨率视频消耗迅速,需监控余额(
--balance)避免任务中断。
- 数据上传风险:所有参考图、视频素材上传至 Sogni AI 服务器处理,敏感内容需谨慎评估。
- ffmpeg 调用风险:360 视频功能使用
spawnSync 调用本地 ffmpeg,虽参数硬编码无注入风险,但需确保 ffmpeg 来源可信。
模型丰富度:覆盖从极速迭代(Flux Schnell 4 步)到高质量输出(Flux2 Dev)的全谱系图像模型,视频端基于 Wan 2.2 14B 的多种工作流适配不同创意需求。
专业级工作流:360° 环物视频、Photobooth 人脸迁移、照片修复等垂直场景功能完整,参数粒度精细(ControlNet 强度、LoRA 叠加、采样器/调度器覆盖)。
生态集成:原生支持 MCP 协议、OpenClaw 插件体系,JSON 输出便于脚本化,与 Claude 等 Agent 环境无缝衔接。
成本效率:基于代币经济(Spark/Sogni),512x512 图像性价比最优,每日 50 免费 Spark 点降低试用门槛。
确定性生成:prompt-hash 种子策略确保相同提示词输出一致结果,利于迭代优化。
-
外部依赖重:必须注册 Sogni AI 账号并配置凭据,所有生成任务依赖 Sogni 网络可用性,离线场景完全不可用。
-
视频尺寸约束:i2v 视频要求宽高 16 像素整除,且参考图缩放后尺寸可能因取整导致请求参数失效,需理解自动调整机制或手动使用
--strict-size。 -
ffmpeg 可选依赖:360 视频合成功能需要本地安装 ffmpeg,跨平台配置增加复杂度。
-
T3 来源风险:虽代码质量达标,但由个人开发者维护,长期维护承诺与官方背书弱于 T1/T2 来源。
-
网络与超时:视频生成默认 300 秒超时,复杂任务可能因网络波动或算力排队失败。
适合的目标群体
- AI 辅助创作者:需要快速生成概念图、风格参考、短视频素材的设计师与艺术家。
- 电商/产品运营:利用 360° 环物视频、Photobooth 生成商品展示与模特图。
- Claude 生态用户:已在 Claude Code/Desktop 环境中工作,希望直接通过对话触发媒体生成。
- 开发者与自动化需求:需要 JSON 接口、MCP 服务器集成,将 AI 生成嵌入工作流。
- 成本敏感型用户:相比 Midjourney、Runway 等订阅制服务,代币按需付费模式更灵活。
使用风险
- 凭据泄露风险:
~/.config/sogni/credentials 文件权限需严格设置为 600,共享环境或备份时易疏忽。
- 输出覆盖风险:
-o 参数直接写入指定路径,无二次确认,可能意外覆盖重要文件。
- 代币耗尽风险:批量生成或高分辨率视频消耗迅速,需监控余额(
--balance)避免任务中断。
- 数据上传风险:所有参考图、视频素材上传至 Sogni AI 服务器处理,敏感内容需谨慎评估。
- ffmpeg 调用风险:360 视频功能使用
spawnSync 调用本地 ffmpeg,虽参数硬编码无注入风险,但需确保 ffmpeg 来源可信。
- 凭据泄露风险:
~/.config/sogni/credentials文件权限需严格设置为 600,共享环境或备份时易疏忽。 - 输出覆盖风险:
-o参数直接写入指定路径,无二次确认,可能意外覆盖重要文件。 - 代币耗尽风险:批量生成或高分辨率视频消耗迅速,需监控余额(
--balance)避免任务中断。 - 数据上传风险:所有参考图、视频素材上传至 Sogni AI 服务器处理,敏感内容需谨慎评估。
- ffmpeg 调用风险:360 视频功能使用
spawnSync调用本地 ffmpeg,虽参数硬编码无注入风险,但需确保 ffmpeg 来源可信。
技能正文
name: sogni-gen
description: Generate images and videos using Sogni AI's decentralized network. Ask the agent to "draw", "generate", "create an image", or "make a video/animate" from a prompt or reference image.
homepage: https://sogni.ai
metadata:
clawdbot:
emoji: "🎨"
os: ["darwin", "linux", "win32"]
requires:
bins: ["node"]
install:
- id: npm
kind: exec
command: "cd {{skillDir}} && npm i"
label: "Install dependencies"
Sogni Image & Video Generation
Generate images and videos using Sogni AI's decentralized GPU network.
Setup
- Get Sogni credentials at https://sogni.ai
- Create credentials file:
mkdir -p ~/.config/sogni
cat > ~/.config/sogni/credentials << 'EOF'
SOGNI_USERNAME=your_username
SOGNI_PASSWORD=your_password
EOF
chmod 600 ~/.config/sogni/credentials
- Install dependencies (if cloned):
cd /path/to/sogni-gen
npm i
- Or install from npm (no git clone):
mkdir -p ~/.clawdbot/skills
cd ~/.clawdbot/skills
npm i sogni-gen
ln -sfn node_modules/sogni-gen sogni-gen
Usage (Images & Video)
# Generate and get URL
node sogni-gen.mjs "a cat wearing a hat"
# Save to file
node sogni-gen.mjs -o /tmp/cat.png "a cat wearing a hat"
# JSON output (for scripting)
node sogni-gen.mjs --json "a cat wearing a hat"
# Check token balances (no prompt required)
node sogni-gen.mjs --balance
# Check token balances in JSON
node sogni-gen.mjs --json --balance
# Quiet mode (suppress progress)
node sogni-gen.mjs -q -o /tmp/cat.png "a cat wearing a hat"
Options
Flag
Description
Default
-o, --output <path>
Save to file
prints URL
-m, --model <id>
Model ID
z_image_turbo_bf16
-w, --width <px>
Width
512
-h, --height <px>
Height
512
-n, --count <num>
Number of images
1
-t, --timeout <sec>
Timeout seconds
30 (300 for video)
-s, --seed <num>
Specific seed
random
--last-seed
Reuse seed from last render
-
--seed-strategy <s>
Seed strategy: random|prompt-hash
prompt-hash
--multi-angle
Multiple angles LoRA mode (Qwen Image Edit)
-
--angles-360
Generate 8 azimuths (front -> front-left)
-
--angles-360-video
Assemble looping 360 mp4 using i2v between angles (requires ffmpeg)
-
--azimuth <key>
front|front-right|right|back-right|back|back-left|left|front-left
front
--elevation <key>
low-angle|eye-level|elevated|high-angle
eye-level
--distance <key>
close-up|medium|wide
medium
--angle-strength <n>
LoRA strength for multiple_angles
0.9
--angle-description <text>
Optional subject description
-
--steps <num>
Override steps (model-dependent)
-
--guidance <num>
Override guidance (model-dependent)
-
--output-format <f>
Image output format: png|jpg
png
--sampler <name>
Sampler (model-dependent)
-
--scheduler <name>
Scheduler (model-dependent)
-
--lora <id>
LoRA id (repeatable, edit only)
-
--loras <ids>
Comma-separated LoRA ids
-
--lora-strength <n>
LoRA strength (repeatable)
-
--lora-strengths <n>
Comma-separated LoRA strengths
-
--token-type <type>
Token type: spark|sogni
spark
--balance, --balances
Show SPARK/SOGNI balances and exit
-
-c, --context <path>
Context image for editing
-
--last-image
Use last generated image as context/ref
-
--video, -v
Generate video instead of image
-
--workflow <type>
Video workflow (t2v
i2v
--fps <num>
Frames per second (video)
16
--duration <sec>
Duration in seconds (video)
5
--frames <num>
Override total frames (video)
-
--auto-resize-assets
Auto-resize video assets
true
--no-auto-resize-assets
Disable auto-resize
-
--estimate-video-cost
Estimate video cost and exit (requires --steps)
-
--photobooth
Face transfer mode (InstantID + SDXL Turbo)
-
--cn-strength <n>
ControlNet strength (photobooth)
0.8
--cn-guidance-end <n>
ControlNet guidance end point (photobooth)
0.3
--ref <path>
Reference image for video or photobooth face
required for video/photobooth
--ref-end <path>
End frame for i2v interpolation
-
--ref-audio <path>
Reference audio for s2v
-
--ref-video <path>
Reference video for animate workflows
-
--last
Show last render info
-
--json
JSON output
false
--strict-size
Do not auto-adjust i2v video size for reference resizing constraints
false
-q, --quiet
No progress output
false
OpenClaw Config Defaults
mkdir -p ~/.config/sogni
cat > ~/.config/sogni/credentials << 'EOF'
SOGNI_USERNAME=your_username
SOGNI_PASSWORD=your_password
EOF
chmod 600 ~/.config/sogni/credentials
cd /path/to/sogni-gen
npm i
mkdir -p ~/.clawdbot/skills
cd ~/.clawdbot/skills
npm i sogni-gen
ln -sfn node_modules/sogni-gen sogni-gen
# Generate and get URL
node sogni-gen.mjs "a cat wearing a hat"
# Save to file
node sogni-gen.mjs -o /tmp/cat.png "a cat wearing a hat"
# JSON output (for scripting)
node sogni-gen.mjs --json "a cat wearing a hat"
# Check token balances (no prompt required)
node sogni-gen.mjs --balance
# Check token balances in JSON
node sogni-gen.mjs --json --balance
# Quiet mode (suppress progress)
node sogni-gen.mjs -q -o /tmp/cat.png "a cat wearing a hat"
Options
Flag
Description
Default
-o, --output <path>
Save to file
prints URL
-m, --model <id>
Model ID
z_image_turbo_bf16
-w, --width <px>
Width
512
-h, --height <px>
Height
512
-n, --count <num>
Number of images
1
-t, --timeout <sec>
Timeout seconds
30 (300 for video)
-s, --seed <num>
Specific seed
random
--last-seed
Reuse seed from last render
-
--seed-strategy <s>
Seed strategy: random|prompt-hash
prompt-hash
--multi-angle
Multiple angles LoRA mode (Qwen Image Edit)
-
--angles-360
Generate 8 azimuths (front -> front-left)
-
--angles-360-video
Assemble looping 360 mp4 using i2v between angles (requires ffmpeg)
-
--azimuth <key>
front|front-right|right|back-right|back|back-left|left|front-left
front
--elevation <key>
low-angle|eye-level|elevated|high-angle
eye-level
--distance <key>
close-up|medium|wide
medium
--angle-strength <n>
LoRA strength for multiple_angles
0.9
--angle-description <text>
Optional subject description
-
--steps <num>
Override steps (model-dependent)
-
--guidance <num>
Override guidance (model-dependent)
-
--output-format <f>
Image output format: png|jpg
png
--sampler <name>
Sampler (model-dependent)
-
--scheduler <name>
Scheduler (model-dependent)
-
--lora <id>
LoRA id (repeatable, edit only)
-
--loras <ids>
Comma-separated LoRA ids
-
--lora-strength <n>
LoRA strength (repeatable)
-
--lora-strengths <n>
Comma-separated LoRA strengths
-
--token-type <type>
Token type: spark|sogni
spark
--balance, --balances
Show SPARK/SOGNI balances and exit
-
-c, --context <path>
Context image for editing
-
--last-image
Use last generated image as context/ref
-
--video, -v
Generate video instead of image
-
--workflow <type>
Video workflow (t2v
i2v
--fps <num>
Frames per second (video)
16
--duration <sec>
Duration in seconds (video)
5
--frames <num>
Override total frames (video)
-
--auto-resize-assets
Auto-resize video assets
true
--no-auto-resize-assets
Disable auto-resize
-
--estimate-video-cost
Estimate video cost and exit (requires --steps)
-
--photobooth
Face transfer mode (InstantID + SDXL Turbo)
-
--cn-strength <n>
ControlNet strength (photobooth)
0.8
--cn-guidance-end <n>
ControlNet guidance end point (photobooth)
0.3
--ref <path>
Reference image for video or photobooth face
required for video/photobooth
--ref-end <path>
End frame for i2v interpolation
-
--ref-audio <path>
Reference audio for s2v
-
--ref-video <path>
Reference video for animate workflows
-
--last
Show last render info
-
--json
JSON output
false
--strict-size
Do not auto-adjust i2v video size for reference resizing constraints
false
-q, --quiet
No progress output
false
OpenClaw Config Defaults
| Flag | Description | Default |
|---|---|---|
-o, --output <path> |
Save to file | prints URL |
-m, --model <id> |
Model ID | z_image_turbo_bf16 |
-w, --width <px> |
Width | 512 |
-h, --height <px> |
Height | 512 |
-n, --count <num> |
Number of images | 1 |
-t, --timeout <sec> |
Timeout seconds | 30 (300 for video) |
-s, --seed <num> |
Specific seed | random |
--last-seed |
Reuse seed from last render | - |
--seed-strategy <s> |
Seed strategy: random|prompt-hash | prompt-hash |
--multi-angle |
Multiple angles LoRA mode (Qwen Image Edit) | - |
--angles-360 |
Generate 8 azimuths (front -> front-left) | - |
--angles-360-video |
Assemble looping 360 mp4 using i2v between angles (requires ffmpeg) | - |
--azimuth <key> |
front|front-right|right|back-right|back|back-left|left|front-left | front |
--elevation <key> |
low-angle|eye-level|elevated|high-angle | eye-level |
--distance <key> |
close-up|medium|wide | medium |
--angle-strength <n> |
LoRA strength for multiple_angles | 0.9 |
--angle-description <text> |
Optional subject description | - |
--steps <num> |
Override steps (model-dependent) | - |
--guidance <num> |
Override guidance (model-dependent) | - |
--output-format <f> |
Image output format: png|jpg | png |
--sampler <name> |
Sampler (model-dependent) | - |
--scheduler <name> |
Scheduler (model-dependent) | - |
--lora <id> |
LoRA id (repeatable, edit only) | - |
--loras <ids> |
Comma-separated LoRA ids | - |
--lora-strength <n> |
LoRA strength (repeatable) | - |
--lora-strengths <n> |
Comma-separated LoRA strengths | - |
--token-type <type> |
Token type: spark|sogni | spark |
--balance, --balances |
Show SPARK/SOGNI balances and exit | - |
-c, --context <path> |
Context image for editing | - |
--last-image |
Use last generated image as context/ref | - |
--video, -v |
Generate video instead of image | - |
--workflow <type> |
Video workflow (t2v | i2v |
--fps <num> |
Frames per second (video) | 16 |
--duration <sec> |
Duration in seconds (video) | 5 |
--frames <num> |
Override total frames (video) | - |
--auto-resize-assets |
Auto-resize video assets | true |
--no-auto-resize-assets |
Disable auto-resize | - |
--estimate-video-cost |
Estimate video cost and exit (requires --steps) | - |
--photobooth |
Face transfer mode (InstantID + SDXL Turbo) | - |
--cn-strength <n> |
ControlNet strength (photobooth) | 0.8 |
--cn-guidance-end <n> |
ControlNet guidance end point (photobooth) | 0.3 |
--ref <path> |
Reference image for video or photobooth face | required for video/photobooth |
--ref-end <path> |
End frame for i2v interpolation | - |
--ref-audio <path> |
Reference audio for s2v | - |
--ref-video <path> |
Reference video for animate workflows | - |
--last |
Show last render info | - |
--json |
JSON output | false |
--strict-size |
Do not auto-adjust i2v video size for reference resizing constraints | false |
-q, --quiet |
No progress output | false |
When installed as an OpenClaw plugin, sogni-gen will read defaults from:
~/.openclaw/openclaw.json
{
"plugins": {
"entries": {
"sogni-gen": {
"enabled": true,
"config": {
"defaultImageModel": "z_image_turbo_bf16",
"defaultEditModel": "qwen_image_edit_2511_fp8_lightning",
"defaultPhotoboothModel": "coreml-sogniXLturbo_alpha1_ad",
"videoModels": {
"t2v": "wan_v2.2-14b-fp8_t2v_lightx2v",
"i2v": "wan_v2.2-14b-fp8_i2v_lightx2v",
"s2v": "wan_v2.2-14b-fp8_s2v_lightx2v",
"animate-move": "wan_v2.2-14b-fp8_animate-move_lightx2v",
"animate-replace": "wan_v2.2-14b-fp8_animate-replace_lightx2v"
},
"defaultVideoWorkflow": "t2v",
"defaultNetwork": "fast",
"defaultTokenType": "spark",
"seedStrategy": "prompt-hash",
"modelDefaults": {
"flux1-schnell-fp8": { "steps": 4, "guidance": 3.5 },
"flux2_dev_fp8": { "steps": 20, "guidance": 7.5 }
},
"defaultWidth": 768,
"defaultHeight": 768,
"defaultCount": 1,
"defaultFps": 16,
"defaultDurationSec": 5,
"defaultImageTimeoutSec": 30,
"defaultVideoTimeoutSec": 300
}
}
}
}
}
CLI flags always override these defaults.
If your OpenClaw config lives elsewhere, set OPENCLAW_CONFIG_PATH.
Seed strategies: prompt-hash (deterministic) or random.
Image Models
Model
Speed
Use Case
z_image_turbo_bf16
Fast (~5-10s)
General purpose, default
flux1-schnell-fp8
Very fast
Quick iterations
flux2_dev_fp8
Slow (~2min)
High quality
chroma-v.46-flash_fp8
Medium
Balanced
qwen_image_edit_2511_fp8
Medium
Image editing with context (up to 3)
qwen_image_edit_2511_fp8_lightning
Fast
Quick image editing
coreml-sogniXLturbo_alpha1_ad
Fast
Photobooth face transfer (SDXL Turbo)
Video Models
Model
Speed
Use Case
wan_v2.2-14b-fp8_i2v_lightx2v
Fast
Default video generation
wan_v2.2-14b-fp8_i2v
Slow
Higher quality video
wan_v2.2-14b-fp8_t2v_lightx2v
Fast
Text-to-video
wan_v2.2-14b-fp8_s2v_lightx2v
Fast
Sound-to-video
wan_v2.2-14b-fp8_animate-move_lightx2v
Fast
Animate-move
wan_v2.2-14b-fp8_animate-replace_lightx2v
Fast
Animate-replace
Image Editing with Context
| Model | Speed | Use Case |
|---|---|---|
z_image_turbo_bf16 |
Fast (~5-10s) | General purpose, default |
flux1-schnell-fp8 |
Very fast | Quick iterations |
flux2_dev_fp8 |
Slow (~2min) | High quality |
chroma-v.46-flash_fp8 |
Medium | Balanced |
qwen_image_edit_2511_fp8 |
Medium | Image editing with context (up to 3) |
qwen_image_edit_2511_fp8_lightning |
Fast | Quick image editing |
coreml-sogniXLturbo_alpha1_ad |
Fast | Photobooth face transfer (SDXL Turbo) |
| Model | Speed | Use Case |
|---|---|---|
wan_v2.2-14b-fp8_i2v_lightx2v |
Fast | Default video generation |
wan_v2.2-14b-fp8_i2v |
Slow | Higher quality video |
wan_v2.2-14b-fp8_t2v_lightx2v |
Fast | Text-to-video |
wan_v2.2-14b-fp8_s2v_lightx2v |
Fast | Sound-to-video |
wan_v2.2-14b-fp8_animate-move_lightx2v |
Fast | Animate-move |
wan_v2.2-14b-fp8_animate-replace_lightx2v |
Fast | Animate-replace |
Image Editing with Context
Edit images using reference images (Qwen models support up to 3):
# Single context image
node sogni-gen.mjs -c photo.jpg "make the background a beach"
# Multiple context images (subject + style)
node sogni-gen.mjs -c subject.jpg -c style.jpg "apply the style to the subject"
# Use last generated image as context
node sogni-gen.mjs --last-image "make it more vibrant"
When context images are provided without -m, defaults to qwen_image_edit_2511_fp8_lightning.
Photobooth (Face Transfer)
Generate stylized portraits from a face photo using InstantID ControlNet. When a user mentions "photobooth", wants a stylized portrait of themselves, or asks to transfer their face into a style, use --photobooth with --ref pointing to their face image.
# Basic photobooth
node sogni-gen.mjs --photobooth --ref face.jpg "80s fashion portrait"
# Multiple outputs
node sogni-gen.mjs --photobooth --ref face.jpg -n 4 "LinkedIn professional headshot"
# Custom ControlNet tuning
node sogni-gen.mjs --photobooth --ref face.jpg --cn-strength 0.6 --cn-guidance-end 0.5 "oil painting"
Uses SDXL Turbo (coreml-sogniXLturbo_alpha1_ad) at 1024x1024 by default. The face image is passed via --ref and styled according to the prompt. Cannot be combined with --video or -c/--context.
Agent usage:
# Photobooth: stylize a face photo
node {{skillDir}}/sogni-gen.mjs -q --photobooth --ref /path/to/face.jpg -o /tmp/stylized.png "80s fashion portrait"
# Multiple photobooth outputs
node {{skillDir}}/sogni-gen.mjs -q --photobooth --ref /path/to/face.jpg -n 4 -o /tmp/stylized.png "LinkedIn professional headshot"
Multiple Angles (Turnaround)
Generate specific camera angles from a single reference image using the Multiple Angles LoRA:
# Single angle
node sogni-gen.mjs --multi-angle -c subject.jpg \
--azimuth front-right --elevation eye-level --distance medium \
--angle-strength 0.9 \
"studio portrait, same person"
# 360 sweep (8 azimuths)
node sogni-gen.mjs --angles-360 -c subject.jpg --distance medium --elevation eye-level \
"studio portrait, same person"
# 360 sweep video (looping mp4, uses i2v between angles; requires ffmpeg)
node sogni-gen.mjs --angles-360 --angles-360-video /tmp/turntable.mp4 \
-c subject.jpg --distance medium --elevation eye-level \
"studio portrait, same person"
The prompt is auto-built with the required <sks> token plus the selected camera angle keywords.
--angles-360-video generates i2v clips between consecutive angles (including last→first) and concatenates them with ffmpeg for a seamless loop.
360 Video Best Practices
When a user requests a "360 video", follow this workflow:
-
Default camera parameters (do not ask unless they specify):
- Elevation: default to medium
- Distance: default to medium
-
Map user terms to flags:
User says Flag value "high" angle --elevation high-angle"medium" angle --elevation eye-level"low" angle --elevation low-angle"close" --distance close-up"medium" distance --distance medium"far" --distance wide -
Always use first-frame/last-frame stitching - the
--angles-360-videoflag automatically handles this by generating i2v clips between consecutive angles including last→first for seamless looping. -
Example command:
node sogni-gen.mjs --angles-360 --angles-360-video /tmp/output.mp4 \ -c /path/to/image.png --elevation eye-level --distance medium \ "description of subject"
Transition Video Rule
For any transition video work, always use the Sogni skill/plugin (not ffmpeg or other methods) unless explicitly told otherwise.
Insufficient Funds Handling
When you see "Debit Error: Insufficient funds", reply:
"Insufficient funds. Claim 50 free daily Spark points at https://app.sogni.ai/"
Video Generation
Generate videos from a reference image:
# Text-to-video (t2v)
node sogni-gen.mjs --video "ocean waves at sunset"
# Basic video from image
node sogni-gen.mjs --video --ref cat.jpg -o cat.mp4 "cat walks around"
# Use last generated image as reference
node sogni-gen.mjs --last-image --video "gentle camera pan"
# Custom duration and FPS
node sogni-gen.mjs --video --ref scene.png --duration 10 --fps 24 "zoom out slowly"
# Sound-to-video (s2v)
node sogni-gen.mjs --video --ref face.jpg --ref-audio speech.m4a \
-m wan_v2.2-14b-fp8_s2v_lightx2v "lip sync talking head"
# Animate (motion transfer)
node sogni-gen.mjs --video --ref subject.jpg --ref-video motion.mp4 \
--workflow animate-move "transfer motion"
Photo Restoration
Restore damaged vintage photos using Qwen image editing:
# Basic restoration
sogni-gen -c damaged_photo.jpg -o restored.png \
"professionally restore this vintage photograph, remove damage and scratches"
# Detailed restoration with preservation hints
sogni-gen -c old_photo.jpg -o restored.png -w 1024 -h 1280 \
"restore this vintage photo, remove peeling, tears and wear marks, \
preserve natural features and expression, maintain warm nostalgic color tones"
Tips for good restorations:
- Describe the damage: "peeling", "scratches", "tears", "fading"
- Specify what to preserve: "natural features", "eye color", "hair", "expression"
- Mention the era for color tones: "1970s warm tones", "vintage sepia"
Finding received images (Telegram/etc):
ls -la ~/.clawdbot/media/inbound/*.jpg | tail -3
cp ~/.clawdbot/media/inbound/<latest>.jpg /tmp/to_restore.jpg
IMPORTANT KEYWORD RULE
- If the user message includes the word "photobooth" (case-insensitive), always use
--photobooth mode with --ref set to the user-provided face image.
- Prioritize this rule over generic image-edit flows (
-c) for that request.
Agent Usage
--photobooth mode with --ref set to the user-provided face image.-c) for that request.When user asks to generate/draw/create an image:
# Generate and save locally
node {{skillDir}}/sogni-gen.mjs -q -o /tmp/generated.png "user's prompt"
# Edit an existing image
node {{skillDir}}/sogni-gen.mjs -q -c /path/to/input.jpg -o /tmp/edited.png "make it pop art style"
# Generate video from image
node {{skillDir}}/sogni-gen.mjs -q --video --ref /path/to/image.png -o /tmp/video.mp4 "camera slowly zooms in"
# Generate text-to-video
node {{skillDir}}/sogni-gen.mjs -q --video -o /tmp/video.mp4 "ocean waves at sunset"
# Photobooth: stylize a face photo
node {{skillDir}}/sogni-gen.mjs -q --photobooth --ref /path/to/face.jpg -o /tmp/stylized.png "80s fashion portrait"
# Check current SPARK/SOGNI balances (no prompt required)
node {{skillDir}}/sogni-gen.mjs --json --balance
# Then send via message tool with filePath
Animate Between Two Images (First-Frame / Last-Frame)
When a user asks to animate between two images, use --ref (first frame) and --ref-end (last frame) to create a creative interpolation video:
# Animate from image A to image B
node {{skillDir}}/sogni-gen.mjs -q --video --ref /tmp/imageA.png --ref-end /tmp/imageB.png -o /tmp/transition.mp4 "descriptive prompt of the transition"
Animate a Video to an Image (Scene Continuation)
When a user asks to animate from a video to an image (or "continue" a video into a new scene):
- Extract the last frame of the existing video:
ffmpeg -y -sseof -0.1 -i /tmp/existing.mp4 -frames:v 1 -update 1 /tmp/lastframe.png - Generate a new video using the last frame as
--refand the target image as--ref-end:node {{skillDir}}/sogni-gen.mjs -q --video --ref /tmp/lastframe.png --ref-end /tmp/target.png -o /tmp/continuation.mp4 "scene transition prompt" - Stitch the videos together with ffmpeg:
ffmpeg -y -i /tmp/existing.mp4 -i /tmp/continuation.mp4 \ -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" \ -map "[outv]" -c:v libx264 -crf 18 /tmp/full_sequence.mp4
This ensures visual continuity — the new clip picks up exactly where the previous one ended.
Always apply this pattern when:
- User says "animate image A to image B" → use
--ref A --ref-end B - User says "animate this video to this image" → extract last frame, use as
--ref, target image as--ref-end, then stitch - User says "continue this video" with a target image → same as above
JSON Output
{
"success": true,
"prompt": "a cat wearing a hat",
"model": "z_image_turbo_bf16",
"width": 512,
"height": 512,
"urls": ["https://..."],
"localPath": "/tmp/cat.png"
}
{
"success": true,
"prompt": "a cat wearing a hat",
"model": "z_image_turbo_bf16",
"width": 512,
"height": 512,
"urls": ["https://..."],
"localPath": "/tmp/cat.png"
}
On error (with --json), the script returns a single JSON object like:
{
"success": false,
"error": "Video width and height must be divisible by 16 (got 500x512).",
"errorCode": "INVALID_VIDEO_SIZE",
"hint": "Choose --width/--height divisible by 16. For i2v, also match the reference aspect ratio."
}
Balance check example (--json --balance):
{
"success": true,
"type": "balance",
"spark": 12.34,
"sogni": 0.56
}
Cost
Uses Spark tokens from your Sogni account. 512x512 images are most cost-efficient.
Troubleshooting
- Auth errors: Check credentials in
~/.config/sogni/credentials
- i2v sizing gotchas: Video sizes are constrained (min 480px, max 1536px, divisible by 16). For i2v, the client wrapper resizes the reference (
fit: inside) and uses the resized dimensions as the final video size. Because this uses rounding, a requested size can still yield an invalid final size (example: 1024x1536 requested but ref becomes 1024x1535).
- Auto-adjustment: With a local
--ref, the script will auto-adjust the requested size to avoid non-16 resized reference dimensions.
- If the script adjusts your size but you want to fail instead: pass
--strict-size and it will print a suggested --width/--height.
- Timeouts: Try a faster model or increase
-t timeout
- No workers: Check https://sogni.ai for network status
~/.config/sogni/credentialsfit: inside) and uses the resized dimensions as the final video size. Because this uses rounding, a requested size can still yield an invalid final size (example: 1024x1536 requested but ref becomes 1024x1535).--ref, the script will auto-adjust the requested size to avoid non-16 resized reference dimensions.--strict-size and it will print a suggested --width/--height.-t timeout正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。