算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
ai-sprite-generator【设计与创意】Generate 2D sprite sheets for game development using each::sense AI. Create animated character sprites, walk cycles, attack animations, idle loops, and effect sprites in pixel art or hand-drawn styles. Supports side-scrolling, top-down, and isometric perspectives. Use for: 2D game development, pixel art animation, character sprites, game prototyping,…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Generate 2D sprite sheets and animated character sprites using each::sense — the intelligent AI agent that automatically selects the best model for your request.
Requires an each::labs API key. Get one at eachlabs.ai.
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Generate a pixel art sprite sheet showing a knight character walk cycle. 8 frames in a horizontal strip, side-view facing right, 32x32 pixels per frame. The knight wears silver armor with a blue cape and carries a sword. Classic 16-bit SNES style, transparent background, evenly spaced frames."
}
],
"stream": false
}'
from openai import OpenAI
client = OpenAI(
api_key="YOUR_EACHLABS_API_KEY",
base_url="https://eachsense-agent.core.eachlabs.run/v1"
)
response = client.chat.completions.create(
model="eachsense/beta",
messages=[{
"role": "user",
"content": "Generate a pixel art sprite sheet showing a knight character walk cycle. 8 frames in a horizontal strip, side-view facing right, 32x32 pixels per frame. The knight wears silver armor with a blue cape and carries a sword. Classic 16-bit SNES style, transparent background, evenly spaced frames."
}]
)
print(response.choices[0].message.content)
Match the style of existing sprites:
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Create a new enemy sprite sheet matching the art style of this reference. Design a skeleton archer: idle pose, drawing bow, releasing arrow, and taking damage. 4 frames horizontal strip, same pixel size and palette as the reference."},
{"type": "image_url", "image_url": {"url": "https://example.com/existing-sprites.png"}}
]
}
],
"stream": false
}'
Images are sent inside messages using the OpenAI multimodal content format. Maximum 4 images per request.
Set "stream": true for real-time SSE responses, or "stream": false for complete result in a single response. Streaming is useful for showing progress in UIs; non-streaming is simpler for scripts and automation.
| Type | Frames | Description |
|---|---|---|
| Walk Cycle | 4-8 | character locomotion loop |
| Run Cycle | 6-8 | faster movement loop |
| Idle | 2-4 | breathing or subtle motion loop |
| Attack | 4-6 | swing, slash, or projectile |
| Jump | 3-5 | crouch, rise, apex, fall, land |
| Death | 4-6 | hit reaction and collapse |
| Effect | 4-8 | explosion, magic spell, smoke |
| Direction Set | 4-8 | same pose facing N, S, E, W |
"Generate a [art style] sprite sheet showing [character] [animation type]." + [frame count] + [layout] + [pixel size] + [visual details] + [background]
horizontal strip — all frames in a single row
vertical strip — all frames in a single column
grid layout (4x4) — rows and columns for multiple animations
single sprite — one frame only (static asset)
8-bit NES style (8x8, 16x16 pixels)
16-bit SNES style (16x16, 32x32 pixels)
32-bit style (32x32, 64x64 pixels)
high-res pixel art (64x64, 128x128 pixels)
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Generate a pixel art sprite sheet for a top-down RPG character. A young wizard in blue robes with a pointed hat and a wooden staff. Show walk cycle in 4 directions (down, left, right, up), 4 frames each, arranged in a 4x4 grid. 32x32 pixels per frame, 16-bit JRPG style, transparent background."
}
],
"stream": false
}'
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Generate a pixel art sprite sheet for a slime enemy in a 2D platformer. Green translucent slime blob with two simple dot eyes. Animations: idle (2 frames, gentle bounce), move (4 frames, squish and stretch hopping), and death (3 frames, splat into puddle). All frames in a single horizontal row, 32x32 per frame, cute retro style, transparent background."
}
],
"stream": false
}'
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Generate a hand-drawn 2D sprite sheet for a ninja character. Clean line art with flat color fills, side-view facing right. Show: idle (2 frames), run (6 frames), jump (3 frames), sword slash (4 frames). Each row is one animation, 128x128 pixels per frame. Black outfit, red scarf flowing. White background, clean outlines, indie game style."
}
],
"stream": false
}'
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d '{
"messages": [
{
"role": "user",
"content": "Generate a sprite sheet for a fire explosion effect: 8 frames showing ignition to full blast to smoke dissipation. Horizontal strip, 64x64 pixels per frame, bright orange and yellow flames transitioning to grey smoke in later frames. Dark background, stylized hand-painted VFX, game-ready."
}
],
"stream": false
}'
CHARACTER="a female samurai in red armor with a katana, pixel art 32x32, 16-bit style, side-view facing right, transparent background"
ANIMATIONS=(
"idle animation: 4 frames, subtle breathing motion, sword at rest"
"walk cycle: 6 frames, steady stride, sword at hip"
"attack slash: 5 frames, wind-up and horizontal sword swing"
"jump: 4 frames, crouch, rise, apex with sword raised, falling"
"take damage: 3 frames, recoil backward, flash white"
"death: 4 frames, stumble forward, fall to knees, collapse"
)
for ANIM in "${ANIMATIONS[@]}"; do
curl -X POST https://eachsense-agent.core.eachlabs.run/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-API-Key: $EACHLABS_API_KEY" \
-d "{
\"messages\": [{\"role\": \"user\", \"content\": \"Generate a pixel art sprite sheet: $CHARACTER. $ANIM. Frames in a horizontal strip.\"}],
\"stream\": false
}"
echo "---"
done