Logo: Visual Identity

Visual Identity

Organisatioun
letta-ai
visual-identity

Build and maintain a persistent visual identity for your agent using Flux Kontext Pro. Use when the user asks the agent to generate selfies, avatars, character art, or any image that should look like the same person across generations.

Iwwersiicht

Editeurletta-ai
Repositoryskills
Skill-Nummvisual-identity
Stären
144
Forks
25
Matgeliwwert Dateien
4
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    letta-ai huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Visual Identity an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/letta-ai/skills/tree/main/tools/visual-identity
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/letta-ai/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/tools/visual-identity .claude/skills/visual-identity
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Visual Identity an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Visual Identity automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Visual Identity net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Visual Identity

Build a persistent visual identity that stays consistent across sessions. Supports OpenAI (gpt-image-1) and Flux Kontext Pro.

Two workflows:

  1. Visual identity (primary): Establish a reference appearance, then generate new scenes that preserve the same face and features. Identity persists in the agent's memory across sessions.
  2. Text-to-image (secondary): One-off image generation from a text prompt, no identity persistence.

When to use

  • The user asks "show me what you look like" or wants agent selfies
  • The user wants an avatar, profile picture, or character art
  • The user wants to create a visual identity (a consistent character across scenes)
  • The user provides a reference photo and wants variations or new scenes
  • The user asks you to generate or create any image

Environment

The script auto-detects which provider to use based on environment variables:

PriorityEnv varProviderNotes
1stOPENAI_API_KEYOpenAI gpt-image-1Recommended. Most users already have this.
2ndBFL_API_KEYFlux Kontext ProBetter face consistency. Requires BFL account.

You can override with --provider openai or --provider flux.

If neither key is set, guide the user:

Never ask the user to paste the full key in chat.

Dependencies

Install if missing (prefer uv):

bash
uv pip install requests Pillow

If uv is unavailable:

bash
pip3 install requests Pillow

Workflow 1: Visual Identity (Character Consistency)

This is the primary workflow. The goal is to establish a reference appearance and then generate new scenes that preserve the same face, bone structure, and features.

Step 1: Establish the reference

Either the user provides a photo, or you generate a base character:

Option A -- User provides a reference photo: The user pastes or specifies an image file. Save it to the persistent identity directory (see "Persisting Visual Identity" below).

Option B -- Generate a base character from text: Use text-to-image to create the initial character. Be very specific about physical features. Example prompt:

A portrait of a young woman with shoulder-length auburn hair, green eyes, light freckles, wearing a black leather jacket. Clean background, studio lighting, 3:4 portrait.

Save the result as the reference image.

Step 2: Generate scenes with the reference

Pass the reference image as base64-encoded input_image:

bash
python3 <path-to-skill>/scripts/generate_image.py edit \
  --reference /path/to/canonical.jpg \
  --prompt "The same person is sitting at a desk coding late at night, lit by monitor glow" \
  --out /tmp/identity_coding.jpg

Step 3: Anchor the prompt

Always include an identity-anchoring phrase in every prompt that uses a reference. This tells the model to preserve facial features:

Keep his/her exact face, bone structure, eye color, and hair.

Or more naturally woven into the prompt:

The same man is relaxing on a tropical beach at sunset, wearing a linen shirt. Golden hour lighting. Keep his exact face, bone structure, eye color, and hair.

Step 4: Iterate with the user

  • Show each result and ask for feedback
  • Adjust scene, clothing, lighting, or setting based on feedback
  • Always reuse the same reference image for consistency
  • If the user wants to change the base appearance, go back to Step 1

Example session flow

  1. User: "Create a visual identity for me -- here's my photo"
  2. Agent: Saves reference, generates 2-3 scenes (beach, office, hiking)
  3. User: "I like the beach one but make me wearing a hat"
  4. Agent: Regenerates beach scene with hat, same reference
  5. User: "Now make one of me cooking"
  6. Agent: New scene with same reference

Persisting Visual Identity

Two things persist across sessions: the reference image (binary) and the identity metadata (markdown). They live in different places.

Reference image: agent data directory

Save the canonical reference image to ~/.letta/agents/$AGENT_ID/reference/visual-identity/canonical.jpg. This is outside memfs because binary images would bloat the git-backed memory repo. The reference/ directory persists across sessions.

bash
mkdir -p ~/.letta/agents/$AGENT_ID/reference/visual-identity
cp /tmp/generated_portrait.jpg ~/.letta/agents/$AGENT_ID/reference/visual-identity/canonical.jpg

Identity metadata: memfs

After establishing a visual identity, create a memory file at reference/visual-identity.md in the agent's memory filesystem. This syncs via git like all other memory files.

Use the Memory tool to create it:

memory(command="create", reason="Store visual identity metadata",
  file_path="reference/visual-identity.md",
  description="Agent's persistent visual identity -- reference image path and appearance description.",
  file_text="## Reference Image\n~/.letta/agents/$AGENT_ID/reference/visual-identity/canonical.jpg\n\n## Appearance\n- Hair: shoulder-length auburn, slight wave\n- Eyes: green\n- Skin: light with freckles\n- Build: athletic\n- Distinguishing: small scar above left eyebrow\n\n## Anchoring Phrase\nKeep the exact same face, bone structure, eye color, and hair from the reference image.\n\n## History\n- Established: 2026-04-15\n- User feedback: \"make the hair a bit darker\" -> regenerated, approved")

Auto-detect on load

When this skill is loaded, check the agent's memory tree for reference/visual-identity.md. If it exists:

  • The agent already has an established identity
  • Use the stored reference image path for all image generation requests
  • Prepend the stored anchoring phrase to every prompt
  • Do not ask the user to re-establish their identity

If it does not exist, the agent has no visual identity yet. Offer to create one if the user asks for images.

Updating the identity

If the user wants to change their visual identity:

  1. Generate or receive the new reference image
  2. Overwrite canonical.jpg in the reference directory
  3. Update the memory file with new appearance details
  4. Note the change in the History section

Workflow 2: Text-to-Image

For one-off image generation that does not need identity persistence.

bash
python3 <path-to-skill>/scripts/generate_image.py generate \
  --prompt "A corgi wearing a tiny space helmet on the moon" \
  --out /tmp/corgi_moon.jpg

Or inline with requests (OpenAI):

python
import requests, base64, os

resp = requests.post(
    "https://api.openai.com/v1/images/generations",
    headers={
        "Authorization": f"Bearer {os.environ['OPENAI_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "gpt-image-1",
        "prompt": "A corgi wearing a tiny space helmet on the moon",
        "n": 1,
        "size": "1024x1024",
        "quality": "medium",
    },
).json()

img = base64.b64decode(resp["data"][0]["b64_json"])
with open("/tmp/corgi_moon.png", "wb") as f:
    f.write(img)

Parameters

ParameterValuesDefaultProviderNotes
--promptstringrequiredBothScene description
--referencefile pathnoneBothReference photo for identity mode (edit only)
--provideropenai, fluxautoBothOverride provider auto-detection
--aspect-ratio1:1, 3:4, 4:3, 16:9, 9:163:4BothUse 3:4 for portraits
--output-formatpng, jpeg, webppngBoth
--qualitylow, medium, highmediumOpenAIImage quality
--seedintegerrandomFluxFix for reproducible results
--safety-tolerance0-62FluxHigher = more permissive
--guidance1.5-100variesFluxPrompt adherence strength

Prompting best practices

  • Be specific about physical setting, lighting, clothing, and pose
  • For portraits, specify aspect ratio 3:4 or 4:3
  • For landscapes/scenes, use 16:9
  • Include lighting direction: "golden hour", "studio lighting", "neon-lit"
  • Describe clothing and accessories explicitly
  • For identity mode, always include the anchoring phrase about preserving facial features
  • Avoid contradicting the reference photo (e.g., don't say "blonde hair" if the reference has dark hair)

Rate limits and costs

  • Maximum 6 concurrent requests per API key
  • Queue times: typically 4-10 seconds, can spike to 2+ minutes under load
  • If a request stays in Pending for over 120 seconds, retry once
  • Polling interval: 2 seconds is sufficient
  • Download URLs in the Ready response are signed and expire; save images immediately

CLI reference

Full CLI documentation: references/api.md

Common commands:

bash
# Text-to-image
python3 <path-to-skill>/scripts/generate_image.py generate \
  --prompt "..." --out output.jpg

# Reference-based editing (visual identity)
python3 <path-to-skill>/scripts/generate_image.py edit \
  --reference photo.jpg --prompt "..." --out output.jpg

# Dry run (show request without sending)
python3 <path-to-skill>/scripts/generate_image.py generate \
  --prompt "..." --dry-run

# Custom aspect ratio and seed
python3 <path-to-skill>/scripts/generate_image.py generate \
  --prompt "..." --aspect-ratio 16:9 --seed 42 --out wide.jpg

Error handling

OpenAI:

  • HTTP 400/422: Usually a malformed request or content policy violation
  • HTTP 429: Rate limited -- wait and retry
  • Missing OPENAI_API_KEY: Guide the user to https://platform.openai.com/api-keys

Flux:

  • Insufficient credits: Direct user to https://api.bfl.ai/credits
  • HTTP 422: Usually a malformed request -- check prompt and parameters
  • Pending timeout: Retry the request; the queue may be congested
  • Missing BFL_API_KEY: Guide the user to https://api.bfl.ai

Both:

  • Image too large for base64: Resize to under 10MB before encoding
  • No API key found: See Environment section

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Visual Identity?

Build and maintain a persistent visual identity for your agent using Flux Kontext Pro. Use when the user asks the agent to generate selfies, avatars, character art, or any image that should look like the same person across generations.

Firwat Visual Identity op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Visual Identity besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Visual Identity an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/letta-ai/skills/tree/main/tools/visual-identity an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Visual Identity benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Visual Identity benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Visual Identity domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Visual Identity gratis?

letta-ai huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇