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

ChatGPT · ImageReleased 2022-07-16

How to Use CodeFormer in ChatGPT

CodeFormer restores faces in old photos and AI-generated portraits. Its fidelity control lets you favor cleaner facial details or a closer match to the original.

Prompts to try with CodeFormer in ChatGPT

Copy an example into ChatGPT, or ask in your own words.

Use CodeFormer to restore this old portrait with fidelity set to 0.7. Show the original and restored image together so I can check the person's appearance.

CodeFormerChatGPT
Try asking
  • Use CodeFormer on this AI-generated portrait twice, with fidelity at 0.3 and 0.7. Show both results and point out visible changes around the eyes and mouth.

  • Use CodeFormer to restore the faces in this old group photo with fidelity at 0.7. Keep the whole composition and show close-ups for review.

  • Use CodeFormer on this already cropped and aligned 512 by 512 face image. Use the mode for prepared face crops and fidelity at 0.7.

  • Use CodeFormer to restore this 600 by 400 portrait and double its dimensions to 1200 by 800. Show the result beside the original and flag visible changes to the hair boundary.

How to set up CodeFormer in ChatGPT

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

Use the ChatGPT connector

  1. Add a custom MCP server

    In ChatGPT open Plugins, then Add › Add custom MCP server. Name it Spiral, paste this URL and keep Authentication on OAuth. Tick I understand and want to continue, then click Create.

    https://api.spiral.ai/mcp
  2. Click Connect

    ChatGPT asks to connect Spiral. Connect takes you to Spiral in your browser.

  3. Sign in to Spiral and approve

    Sign in, pick the organization ChatGPT should use and click Authorize. Spiral gives the connection its own API key; ChatGPT never sees it, and you can remove the connection under Settings › Connected apps.

Use the Spiral skill

  1. Send ChatGPT 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 CodeFormer

    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/codeformer",
        "input": {
          "image_url": "https://storage.googleapis.com/falserverless/model_tests/codeformer/codeformer_poor_1.jpeg"
        }
      }'

Then paste one of the prompts above: ChatGPT finds CodeFormer on Spiral, shows the price and runs it.

CodeFormer providers and prices

Spiral runs CodeFormer through fal. Open a card for today's price, with every fee included.

falImage
CodeFormer
fal-ai/codeformer

Settings you can ask for

CodeFormer works from your image URL. Ask ChatGPT for any of these in your prompt.

SettingAllowed valuesDefaultDescription
Fidelitya number0.5

Weight of the fidelity factor.

Upscale factora number from 12

Upscaling factor

Alignedon or offoff

Should faces etc should be aligned.

Only center faceon or offoff

Should only center face be restored

Face upscaleon or offon

Should faces be upscaled

Seeda whole number

Random seed for reproducible generation.

Every API field of CodeFormer is on its tool page: open its card above.

What can you do with CodeFormer in ChatGPT?

Restore an old portrait or repair a face in an AI-generated image during a conversation. Ask the agent for comparisons that help you choose between cleaner details and closer resemblance.

Restore scanned portraits

Use CodeFormer to make restored copies of old portrait scans. Compare a higher fidelity result with the scan before adding it to a photo collection.

Repair generated faces

Run CodeFormer on AI-generated portraits with unsatisfactory facial detail. Compare two fidelity settings and inspect the eyes, mouth, and accessories.

Restore faces within group photos

Use CodeFormer's whole-image processing to restore faces within an old group photograph. Review each person's result and the hair boundaries before keeping the image.

Prepare portrait enlargements

Restore a portrait with CodeFormer and increase the whole-image dimensions for a larger layout. Inspect facial resemblance and blending at the intended display size.

Process aligned face crops

Use CodeFormer on prepared, aligned portrait crops for an image collection. The authors' restoration example uses 512 by 512 face images.

Compare restoration choices

Create CodeFormer results at lower and higher fidelity settings for an editorial review. Keep the source beside both results so an editor can judge resemblance and detail.

Questions about CodeFormer in ChatGPT

Can ChatGPT use CodeFormer?

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

How much does CodeFormer cost in ChatGPT?

Up to $0.00273 per run at the default inputs. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your ChatGPT plan is separate.

Do I need a fal account to use CodeFormer in ChatGPT?

No. Spiral runs CodeFormer on its own fal account. You sign in to Spiral once and never paste a key.

How long does it take to set up CodeFormer in ChatGPT?

About two minutes: add a custom MCP server, then click Connect, then sign in to Spiral and approve.

Does ChatGPT wait while CodeFormer runs?

CodeFormer runs in the background. ChatGPT starts the run, checks on it and gives you the image when it's ready.

What is CodeFormer useful for?

Use it to restore facial detail in old photographs or repair faces in AI-generated portraits. Compare the result with the original before keeping it.

How should I choose the fidelity setting?

Higher values favor resemblance to the original; lower values favor visual quality. Try 0.3 and 0.7 on the same image, then compare facial features before choosing.

Does CodeFormer always preserve the person's appearance?

Identity inconsistencies can remain, especially around unusual accessories. A higher fidelity setting favors resemblance, but review the result yourself.

What image size does CodeFormer produce?

The authors demonstrate cropped face restoration at 512 by 512 pixels. For whole images, the final dimensions follow the upscale factor: doubling a 600 by 400 image produces 1200 by 800.

Where does CodeFormer struggle?

The authors report failures on side-facing portraits and inconsistencies around accessories. Whole-image blending can also damage hair texture at the restored face's boundary.

Get started

Start using CodeFormer in ChatGPT

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

Paste this into ChatGPT:

Set up ChatGPT

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