Skip to main content

stardew-valley-movement-frames

Use when the user wants to generate Stardew Valley-style pixel art RPG character sprites with 4-directional or 8-directional movement frames, create sprite sheets, batch-generate walking animation frames via AI image APIs (即梦 or OpenAI), or mentions 星露谷风格/精灵帧/角色动画/运动帧/sprite sheet/像素角色/游戏角色生成/四向移动/八向移动.

الانتقال إلى التثبيت

معلومات المصدر

المستودع
591522345/sprite-gen
آخر نشاط في المصدر
١٢ يونيو ٢٠٢٦ في ١٦:٢٧
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
١
التفرعات
٠

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
stardew-valley-movement-frames
description
Use when the user wants to generate Stardew Valley-style pixel art RPG character sprites with 4-directional or 8-directional movement frames, create sprite sheets, batch-generate walking animation frames via AI image APIs (即梦 or OpenAI), or mentions 星露谷风格/精灵帧/角色动画/运动帧/sprite sheet/像素角色/游戏角色生成/四向移动/八向移动.
# 星露谷风格四向/八向移动帧自动化技能 Generate Stardew Valley-style top-down pixel-art RPG character movement sprites. Supports 4-directional or 8-directional walking cycles with configurable frame count, using cloud AI image APIs (即梦 by ByteDance, or OpenAI DALL-E) with automated post-processing. --- ## Flow: API Setup First (ALWAYS start here) When this skill is invoked, the VERY FIRST thing you do is check whether an API key is configured. Nothing else happens before this check. ```bash python -c " from sprite_gen.utils.config import get_api_key for api in ['openai', 'jimeng']: key = get_api_key(api) print(f'{api}: {\"configured\" if key else \"NOT configured\"}')" ``` ### If NO API key is configured Immediately ask the user to provide one. Do NOT discuss generation parameters until this is done. 1. Ask: **"请选择生图 API:即梦(字节跳动)还是 OpenAI(DALL-E)?"** 2. After they pick, ask: **"请提供 API Key:"** 3. Save it: ```bash python -c " from sprite_gen.utils.config import set_api_key, set_default_api set_api_key('<openai|jimeng>', '<用户提供的KEY>') set_default_api('<openai|jimeng>') print('API Key 已保存。')" ``` 4. Verify: ```bash python -c " from sprite_gen.adapters.openai_image import OpenAIImageAdapter adapter = OpenAIImageAdapter() print('API 可用' if adapter.health_check() else 'API Key 无效或无法连接')" ``` (Use `JimengAdapter` if user chose 即梦.) 5. Once verified, say "API 就绪,可以开始生成精灵了。" and proceed to the generation flow below. ### If API key IS already configured Say which API is configured and go straight to generation flow: > "当前使用 {openai/即梦} API。开始生成精灵吗?" --- ## Generation Flow (only after API is confirmed working) ### Step 1: Gather Parameters Ask one question at a time: 1. **角色描述(中文)**: e.g. "银甲蓝披风的年轻骑士" 2. **Character description (English)**: e.g. "young knight with silver armor and blue cape" 3. **运动方向**: 四向 (S/W/N/E) 还是八向 (增加 SW/NW/NE/SE)? 4. **每方向帧数**: 4 还是 8? 5. **角色尺寸**: 16 / 32 / 48 / 64 px? 6. **输出格式**: 独立帧 / 精灵表 / 都要? ### Step 2: Confirm ``` Summary: · 角色: {character_cn} · API: {api} · 方向: {count} ({list}) · 帧/方向: {n} (共 {total} 帧) · 尺寸: {size}×{size}px · 输出: {format} · 目录: ./sprites/{name}-{date}/ 开始生成?[Y/n] ``` ### Step 3: Run ```bash python -m sprite_gen.main \ --api {openai|jimeng} \ --character "{english description}" \ --character-cn "{中文描述}" \ --directions {ALL4|ALL8|S,W,N,E} \ --frames {4|8} \ --size {16|32|48|64} \ --output-format {frames|sheet|both} \ --output-dir ./sprites ``` This may take several minutes. The script prints per-frame progress. Each frame is saved individually — re-running with the same output directory will skip already-generated frames (resume support). ### Step 4: Review List results: ```bash ls ./sprites/{name}-{date}/ ls ./sprites/{name}-{date}/frames/ | head -20 ``` Ask if the user wants to regenerate specific directions. ## Regenerate Specific Directions ```bash python -m sprite_gen.main \ --api {api} \ --character "{english}" \ --character-cn "{中文}" \ --directions {W,NW} \ --frames {n} \ --size {size} \ --output-format both \ --output-dir ./sprites/{existing-dir} ``` ## Output Structure ``` ./sprites/{character}-{date}/ ├── frames/ │ ├── S_01.png (朝下·站立) │ ├── S_02.png (朝下·迈步) │ └── ... ├── sprite_sheet.png ├── preview.gif └── manifest.json ``` ## Switching APIs User can switch at any time: ```bash python -c " from sprite_gen.utils.config import set_api_key, set_default_api set_api_key('<openai|jimeng>', '<NEW_KEY>') set_default_api('<openai|jimeng>') " ``` ## Notes - API keys are stored in `~/.claude/sprite-gen-config.json` — never committed to git - Add `sprites/` to `.gitignore` - 即梦 endpoint in `adapters/jimeng.py` is a placeholder — confirm against actual API docs
عرض على GitHub