算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
ai-caricature【设计与创意】Generate caricature and cartoon versions of face photos using each::sense AI. Transform portraits into exaggerated, humorous, or stylized cartoon illustrations in various art styles including comic, manga, Disney, bobblehead, and editorial caricature. Use for: gifts, social media avatars, event entertainment, editorial illustration, profile pictures,…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Transform face photos into caricatures and cartoon portraits 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": [
{"type": "text", "text": "Create a fun caricature of this person. Exaggerate their most prominent features in a friendly, humorous way. Colorful cartoon style with a white background."},
{"type": "image_url", "image_url": {"url": "https://example.com/headshot.jpg"}}
]
}
],
"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": "Create a fun caricature of this person. Exaggerate their most prominent features in a friendly, humorous way. Colorful cartoon style with a white background."
}],
# Images are included in the message content array above
)
print(response.choices[0].message.content)
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": "Turn this person into a caricature cartoon with exaggerated features, comic book style, vibrant colors"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
]
}
],
"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.
| Style | Description | Best For |
|---|---|---|
| Classic Caricature | Exaggerated features, hand-drawn look | Gifts, events, prints |
| Comic Book | Bold lines, halftone dots, superhero feel | Avatars, fun profiles |
| Manga/Anime | Big eyes, anime proportions, stylized hair | Social media, gaming |
| Disney/Pixar | 3D-rendered look, friendly, family-oriented | Profile pics, gifts |
| Bobblehead | Oversized head on tiny body | Humorous gifts, desk art |
| Editorial | Witty, political-cartoon style | Articles, commentary |
| Chibi | Ultra-cute, tiny body, huge head | Stickers, emotes |
| Pop Art | Bold colors, Warhol/Lichtenstein inspired | Wall art, merchandise |
Different caricature styles produce very different results. Always name the style:
Create a [style] caricature of this person. [Feature emphasis]. [Color/background]. [Additional context].
You can guide which features to exaggerate:
Exaggerate the big smile and dimples.
Emphasize the strong jawline and bushy eyebrows.
Make the eyes extra large and expressive.
Adding context makes caricatures more fun:
Show them holding a laptop, wearing a chef hat, riding a skateboard,
playing guitar, in a superhero costume, sitting at a desk
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 classic hand-drawn style caricature of this person. Big exaggerated head on a small body, emphasize their smile and eyes. They are holding a paintbrush and standing next to an easel. Colorful, fun, white background."},
{"type": "image_url", "image_url": {"url": "https://example.com/friend-photo.jpg"}}
]
}
],
"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": [
{"type": "text", "text": "Transform this person into an anime character. Large expressive eyes, stylized spiky hair matching their hair color, manga shading, dynamic pose with sparkle effects. Keep their distinctive features recognizable in the anime style."},
{"type": "image_url", "image_url": {"url": "https://example.com/selfie.jpg"}}
]
}
],
"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": [
{"type": "text", "text": "Turn this person into a Pixar-style 3D animated character. Slightly oversized head, big warm eyes, friendly expression, smooth stylized skin. Place them in front of a colorful background. Keep their hairstyle and clothing recognizable."},
{"type": "image_url", "image_url": {"url": "https://example.com/portrait.jpg"}}
]
}
],
"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": [
{"type": "text", "text": "Create a pop art portrait of this person in the style of Andy Warhol. Bold flat colors, high contrast, halftone dot pattern, four-panel grid with different color combinations: pink/yellow, blue/green, orange/purple, red/teal."},
{"type": "image_url", "image_url": {"url": "https://example.com/face-photo.jpg"}}
]
}
],
"stream": false
}'
# Step 1: Generate the main caricature
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 clean cartoon avatar of this person. Flat vector illustration style, simplified features but recognizable, circular crop suitable for a profile picture, vibrant solid color background."},
{"type": "image_url", "image_url": {"url": "https://example.com/my-photo.jpg"}}
]
}
],
"stream": false
}'
# Step 2: Generate variations for different platforms
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 cartoon avatar of this person in a professional style. Wearing a blazer, subtle smile, clean lines, minimal detail, dark blue background, suitable for a LinkedIn or business profile."},
{"type": "image_url", "image_url": {"url": "https://example.com/my-photo.jpg"}}
]
}
],
"stream": false
}'
# Step 3: Fun version for gaming/social
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 an anime chibi version of this person. Oversized head, tiny body, big sparkly eyes, excited expression, wearing headphones and holding a game controller. Colorful pastel background with stars."},
{"type": "image_url", "image_url": {"url": "https://example.com/my-photo.jpg"}}
]
}
],
"stream": false
}'