How to Use PuLID Flux in VS Code
PuLID Flux creates new portraits from a reference face and a text description, including photographic and illustrated treatments. It adds identity preservation to FLUX.1 dev without training a model for each person.
Prompts to try with PuLID Flux in VS Code
Copy an example into VS Code, or ask in your own words.
Use PuLID Flux with the reference portrait in this project's assets to create a headshot for the speaker page. Match the page's visual direction, use soft window light, and show me the result before replacing the current image.
Use PuLID Flux with the project's reference face to create a 1280 by 720 banner concept. Place the person on the right, leave the left side uncluttered for HTML text, and use a plain studio background.
Use PuLID Flux with the reference portrait in the project to create a comic profile image. Frame the head and shoulders centrally and follow the colors described in our design notes.
Use PuLID Flux to make a portrait lighting study from the project's reference photo: soft daylight, candlelight, and direct studio light. Save each result separately for review.
Use PuLID Flux with the project's reference portrait to compare ordinary guidance against true CFG for an illustrated avatar. For the true CFG test, set true_cfg to 2 and guidance_scale to 1; record the settings with each image.
How to set up PuLID Flux in VS Code
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Add the hosted server
Use Add to VS Code on the console's Agents & MCP page, or run:
code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}' - Sign in
VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.
Use the Spiral skill
- Send VS Code this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run PuLID Flux
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "fal", "model": "fal-ai/flux-pulid", "input": { "prompt": "a woman holding sign with glowing green text '\''PuLID for FLUX'\''", "reference_image_url": "https://storage.googleapis.com/falserverless/gallery/example_inputs_liuyifei.png" } }'
Then paste one of the prompts above: VS Code finds PuLID Flux on Spiral, shows the price and runs it.
PuLID Flux providers and prices
Spiral runs PuLID Flux through fal. Open a card for today's price, with every fee included.
$0.04329 per megapixel. image_size presets count as 1 MP; custom sizes round up to whole megapixels.
Settings you can ask for
PuLID Flux works from your prompt. Ask VS Code for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Number of inference steps | 1 to 50 | 20 | The number of inference steps to perform. |
| Seed | a whole number | The same seed and the same prompt given to the same version of the model will output the same image every time. | |
| Guidance scale (CFG) | 0 to 20 | 4 | The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. |
| Negative prompt | what to leave out, in words | The prompt to generate an image from. | |
| Start step | 0 to 50 | 0 | The number of steps to start the CFG from. |
| True CFG | 1 to 10 | 1 | The weight of the CFG loss. |
| ID weight | 0 to 1 | 1 | The weight of the ID loss. |
| Max sequence length | 128, 256, or 512 | 128 | The maximum sequence length for the model. |
Every API field of PuLID Flux is on its tool page: open its card above.
What can you do with PuLID Flux in VS Code?
Create portrait assets for a project's profile screens, speaker pages, and image previews from reference faces. Use the project's design requirements to guide composition, then review likeness before adding a result.
Professional headshot concepts
Use a reference portrait to explore studio lighting, wardrobe, and backgrounds. Review facial resemblance before selecting a result.
Illustrated profile pictures
Turn a reference face into a comic or painted portrait. Specify the medium and framing in the description.
Speaker banner portraits
Create a wide portrait concept from a speaker's reference photo, with the person to one side and room for event copy.
Portrait lighting studies
Explore window light, candlelight, and studio lighting using the same reference face. Compare resemblance alongside the lighting treatment.
Character concept portraits
Use a reference face to explore a character's costume, setting, and visual style for a pitch or storyboard.
Creator thumbnail concepts
Generate portrait concepts from a creator's reference photo, changing the background and composition to match a video's subject.
More on PuLID Flux and VS Code
Overview
PuLID Flux in other agents
Questions about PuLID Flux in VS Code
Can VS Code use PuLID Flux?
Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run PuLID Flux like any built-in tool.
How much does PuLID Flux cost in VS Code?
$0.04329 per megapixel. `image_size` presets count as 1 MP; custom sizes round up to whole megapixels. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your VS Code plan is separate.
Do I need a fal account to use PuLID Flux in VS Code?
No. Spiral runs PuLID Flux on its own fal account. You sign in to Spiral once and never paste a key.
How long does it take to set up PuLID Flux in VS Code?
About two minutes: add the hosted server, then sign in.
Does VS Code wait while PuLID Flux runs?
PuLID Flux runs in the background. VS Code starts the run, checks on it and gives you the image when it's ready.
What is PuLID Flux good for?
Use it to create new portraits that retain a reference person's facial identity. Headshots, illustrated avatars, and portraits with different lighting or settings are practical starting points.
Does PuLID Flux require training for each person?
No. It conditions image generation on a reference identity without a separate training run for that person.
Can PuLID Flux create illustrated portraits?
Yes. The maker documents stylized generation alongside realistic portraits. Specify the treatment, composition, and lighting you want, then check whether the face remains recognizable.
Will PuLID Flux preserve the face exactly?
Treat likeness as something to review, not a guarantee. The maker describes a tradeoff between identity fidelity and editability, so assess both resemblance and the requested changes.
Why might a negative prompt have no effect?
The official implementation processes negative prompts only when true CFG is active. The maker recommends ordinary guidance for most work; when testing true CFG above 1, set ordinary guidance to 1.
Start using PuLID Flux in VS Code
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into VS Code:
set up https://spiral.ai/SKILL.md



