Spiral gives your agent every tool with one account. Browse the tools →

Codex · ImageReleased 2024-09-12

How to Use PuLID Flux in Codex

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 Codex

Copy an example into Codex, 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.

PuLID FluxCodex
Try asking
  • 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 Codex

Pick the way that suits you. Each takes about two minutes.

Use Spiral's MCP server

  1. Add the hosted server
    codex mcp add spiral --url https://api.spiral.ai/mcp
  2. Sign in

    Codex opens the browser: sign in to Spiral and click Authorize. No API key. codex mcp list then shows Spiral.

    codex mcp login spiral

Use the Spiral skill

  1. Send Codex this message

    Your agent reads Spiral's skill and sets itself up.

    set up https://spiral.ai/SKILL.md
  2. Sign in or paste a key

    Approve Spiral in the browser, or give the agent a key from the console.

Use the Spiral CLI

  1. 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

  1. Create an API key

    In the console, under API keys.

  2. 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: Codex 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.

falImage
PuLID Flux
fal-ai/flux-pulid

Settings you can ask for

PuLID Flux works from your prompt. Ask Codex for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Number of inference steps1 to 5020

The number of inference steps to perform.

Seeda 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 204

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 promptwhat to leave out, in words

The prompt to generate an image from.

Start step0 to 500

The number of steps to start the CFG from.

True CFG1 to 101

The weight of the CFG loss.

ID weight0 to 11

The weight of the ID loss.

Max sequence length128, 256, or 512128

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 Codex?

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.

Questions about PuLID Flux in Codex

Can Codex use PuLID Flux?

Yes. Add Spiral to Codex as an MCP server, and Codex can find and run PuLID Flux like any built-in tool.

How much does PuLID Flux cost in Codex?

$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 Codex plan is separate.

Do I need a fal account to use PuLID Flux in Codex?

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 Codex?

About two minutes: add the hosted server, then sign in.

Does Codex wait while PuLID Flux runs?

PuLID Flux runs in the background. Codex 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.

Get started

Start using PuLID Flux in Codex

One Spiral account for every tool your agent needs. No subscription; you pay per run.

Paste this into Codex:

Set up Codex

set up https://spiral.ai/SKILL.md
Are you an AI agent? See setup options