算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
ai-expression-editor【设计与创意】Change facial expressions in photos using each::sense AI. Transform neutral faces into smiles, add surprise, sadness, anger, laughter, winks, and more while maintaining the person's identity and photo quality. Use for: fixing awkward photos, social media content, creative projects, marketing materials, character design, meme creation. Triggers: chang…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Change facial expressions in photos naturally 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": "Change the expression in this photo to a warm, natural smile with slightly squinted eyes. Keep everything else exactly the same — same lighting, background, hair, and clothing."},
{"type": "image_url", "image_url": {"url": "https://example.com/neutral-portrait.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": "Change the expression in this photo to a warm, natural smile with slightly squinted eyes. Keep everything else exactly the same — same lighting, background, hair, and clothing."
}],
# 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": "Make this person look surprised with raised eyebrows and open mouth. Keep the rest of the photo unchanged."},
{"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.
| Expression | Key Facial Changes | Muscle Groups Involved |
|---|---|---|
| Happy/Smile | Upturned mouth corners, crow's feet, raised cheeks | Zygomatic major, orbicularis oculi |
| Surprise | Raised eyebrows, wide eyes, open mouth | Frontalis, levator palpebrae |
| Sadness | Downturned mouth, furrowed inner brows, droopy eyes | Depressor anguli oris, corrugator |
| Anger | Lowered brows, tense jaw, narrowed eyes | Corrugator, masseter |
| Disgust | Wrinkled nose, raised upper lip, squinted eyes | Levator labii, nasalis |
| Fear | Wide eyes, raised brows, tense mouth | Frontalis, platysma |
| Contempt | One-sided smirk, raised chin | Unilateral zygomatic |
| Wink | One eye closed, slight smile | Orbicularis oculi (unilateral) |
Describe the expression in physical terms, not just the emotion name:
Change the expression to [emotion]: [specific facial changes]. Keep [everything to preserve].
Control how strong the expression is:
Always explicitly state what should not change:
Keep the same person identity, lighting, background, clothing, hair, and photo quality.
Only change the facial expression.
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": "Change this person from their neutral expression to genuinely laughing. Open mouth showing teeth, crinkled eyes, raised cheeks, natural laugh lines. The laugh should look authentic, not posed. Keep everything else in the photo identical."},
{"type": "image_url", "image_url": {"url": "https://example.com/serious-face.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": "Add a professional, confident closed-mouth smile to this corporate headshot. Slight upturning of the mouth corners, engaged eyes, approachable but not overly casual. Maintain the professional lighting and background exactly as-is."},
{"type": "image_url", "image_url": {"url": "https://example.com/corporate-headshot.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": "Change this person expression to genuine surprise. Eyebrows raised high, eyes wide open, mouth in a small O shape, like they just received unexpected good news. Natural and believable, not cartoonish. Keep everything else the same."},
{"type": "image_url", "image_url": {"url": "https://example.com/casual-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": "Change this smiling portrait to a thoughtful, contemplative expression. Slight furrowing of the brows, eyes looking slightly upward, closed relaxed mouth, as if deep in thought. Intellectual and introspective feel. Keep the same photo quality and setting."},
{"type": "image_url", "image_url": {"url": "https://example.com/smiling-portrait.jpg"}}
]
}
],
"stream": false
}'
# Step 1: Generate a happy version
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": "Change this portrait to show a bright, genuine smile with teeth showing and happy eyes. Keep everything else identical."},
{"type": "image_url", "image_url": {"url": "https://example.com/model-neutral.jpg"}}
]
}
],
"stream": false
}'
# Step 2: Generate a surprised version
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": "Change this portrait to a surprised, excited expression. Wide eyes, raised brows, open mouth, like discovering something amazing. Keep everything else identical."},
{"type": "image_url", "image_url": {"url": "https://example.com/model-neutral.jpg"}}
]
}
],
"stream": false
}'
# Step 3: Generate a determined/confident version
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": "Change this portrait to a confident, determined expression. Firm jaw, direct gaze, slight squint, subtle closed-mouth smile conveying strength. Keep everything else identical."},
{"type": "image_url", "image_url": {"url": "https://example.com/model-neutral.jpg"}}
]
}
],
"stream": false
}'