[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [Phota Image Editing](https://spiral.ai/integrations/opencode/phota-image-editing)

# How to Use Phota Image Editing in opencode

Phota Image Editing changes poses, expressions, lighting, and backgrounds in existing photos while using trained profiles to preserve likeness. Unlike Phota Text to Image, it starts with a photo whose composition you can retain or reshape.

|  |  |
| --- | --- |
| Model | Phota Image Editing |
| Available through | fal |
| Category | Image |
| Price | $0.117 per run at the default inputs. `resolution`: 1K (default) $0.117, 4K $0.234. $0.117 per unit of `num_images`. |
| Returns | image |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Phota Image Editing in opencode

- Use Phota Image Editing on the existing founder portrait in the project. Use the matching saved profile, soften the shadow across the face, and keep the outfit, crop, and background unchanged.
- Use Phota Image Editing to adapt the project's approved portrait for its contact page. Keep the person's likeness and expression, move the subject to the right, and leave clear space on the left for page text.
- Remove the background from the photo I attach with Phota Image Editing and give me a transparent PNG. Save the result in ./assets.
- Use Phota Image Editing to clean up these product shots so they sit on pure white.
- Edit this image with Phota Image Editing: keep the subject, swap the background for a sunlit studio.

## How to set up Phota Image Editing in opencode

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

### Use Spiral's MCP server

1. **Add the server**: Leave out `--global` to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.

```bash
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
```

2. **Sign in**: Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, `/mcps` starts the same sign-in.

```bash
opencode mcp auth spiral
```

3. **Check it**: Spiral shows as connected.

```bash
opencode mcp list
```

### Use the Spiral skill

1. **Send opencode 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.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run Phota Image Editing**: One request; the result comes back by polling or a webhook.

```bash
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/phota/edit",
    "input": {
      "prompt": "Make this scene more realistic but still keep the game vibes",
      "image_urls": [
        "<image_urls>"
      ]
    }
  }'
```

Then paste one of the prompts above: opencode finds Phota Image Editing on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/opencode

## Phota Image Editing tools and prices

- [Phota · Image Editing](https://spiral.ai/tools/fal/fal-ai/phota/edit) (fal): $0.117 per run at the default inputs. `resolution`: 1K (default) $0.117, 4K $0.234. Per unit of `num_images`: 1K (default) $0.117, 4K $0.234.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| num_images | 1 to 4 | 1 | Number of images to generate. |
| profile_ids |  | — | List of profile IDs to use for the image generation. Profiles may be tagged in the prompt as @Profile1, @Profile2, etc. |
| output_format | jpeg, png | jpeg | The format of the generated image. |
| resolution | 1K, 4K | 1K | Resolution of the generated image. |
| aspect_ratio | auto, 1:1, 16:9, 4:3, 3:4, 9:16 | auto | Aspect ratio of the generated image. |
| base_model | nb2, qwen-image-2, flux-2, seedream-5-pro | nb2 | Base model used to render the image. Identity composes on top of whichever base model is selected, so trained profiles work with all of them. Only `nb2` supports `4K`. |

## What can you do with Phota Image Editing in opencode?

Create portraits and campaign imagery that match a project's creative brief. Your coding agent can read the brief, prepare precise image instructions, and place selected results into the project.

### Matching team headshots

Create portraits with the same framing, background, and lighting for a team page. Use each person's trained profile and repeat the photographic direction.

### Profile portraits

Make a recognizable portrait for a speaker bio or social profile, with a setting and expression chosen for the intended audience.

### Seasonal cards

Create holiday portraits featuring known people or pets, with coordinated clothing, lighting, and scenery.

### Campaign photo sets

Carry the same recognizable person through several campaign scenes. Keep the cast and photographic direction consistent while changing the setting.

### Storyboard images

Build individual shots for a storyboard with a recurring cast. Specify each character's position, expression, and action in every scene.

### Keyframes for video

Create still start and end frames featuring the same person for a separate image-to-video model.

### Expression corrections

Start with an existing portrait and adjust the subject's expression or gaze while requesting that the outfit, background, and lighting remain unchanged.

### Combined group portraits

Bring people from separate photos into one group portrait. Reference the relevant profiles and specify placement, shared lighting, and camera perspective.

## Overview

- [fal](https://spiral.ai/providers/fal)
- [All opencode guides](https://spiral.ai/integrations/opencode)

## Phota Image Editing in other agents

- [Amp](https://spiral.ai/integrations/amp/phota-image-editing)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/phota-image-editing)
- [Claude](https://spiral.ai/integrations/claude-desktop/phota-image-editing)
- [Claude Code](https://spiral.ai/integrations/claude-code/phota-image-editing)
- [Cline](https://spiral.ai/integrations/cline/phota-image-editing)
- [Codex](https://spiral.ai/integrations/codex/phota-image-editing)
- [Cursor](https://spiral.ai/integrations/cursor/phota-image-editing)
- [Devin](https://spiral.ai/integrations/devin/phota-image-editing)
- [dots](https://spiral.ai/integrations/dots/phota-image-editing)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/phota-image-editing)
- [Gemini](https://spiral.ai/integrations/gemini/phota-image-editing)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/phota-image-editing)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/phota-image-editing)
- [goose](https://spiral.ai/integrations/goose/phota-image-editing)
- [Grok](https://spiral.ai/integrations/grok/phota-image-editing)
- [Grok Build](https://spiral.ai/integrations/grok-build/phota-image-editing)
- [Hermes](https://spiral.ai/integrations/hermes/phota-image-editing)
- [Instinct](https://spiral.ai/integrations/instinct/phota-image-editing)
- [Manus](https://spiral.ai/integrations/manus/phota-image-editing)
- [Muse](https://spiral.ai/integrations/muse/phota-image-editing)
- [Muse Code](https://spiral.ai/integrations/muse-code/phota-image-editing)
- [n8n](https://spiral.ai/integrations/n8n/phota-image-editing)
- [Notion](https://spiral.ai/integrations/notion/phota-image-editing)
- [OpenClaw](https://spiral.ai/integrations/openclaw/phota-image-editing)
- [Perplexity](https://spiral.ai/integrations/perplexity/phota-image-editing)
- [Raycast](https://spiral.ai/integrations/raycast/phota-image-editing)
- [VS Code](https://spiral.ai/integrations/vscode/phota-image-editing)
- [Windsurf](https://spiral.ai/integrations/windsurf/phota-image-editing)
- [Zapier](https://spiral.ai/integrations/zapier/phota-image-editing)

## More opencode guides

- [Phota Enhance](https://spiral.ai/integrations/opencode/phota-enhance)
- [Phota Text to Image](https://spiral.ai/integrations/opencode/phota-text-to-image)
- [Perspective Change](https://spiral.ai/integrations/opencode/perspective-change)
- [Photo Restoration](https://spiral.ai/integrations/opencode/photo-restoration)
- [Parabolize](https://spiral.ai/integrations/opencode/parabolize)
- [Photo Restoration fal](https://spiral.ai/integrations/opencode/photo-restoration-fal)

## Questions about Phota Image Editing in opencode

**Can opencode use Phota Image Editing?**

Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Phota Image Editing like any built-in tool.

**How much does Phota Image Editing cost in opencode?**

$0.117 per run at the default inputs. `resolution`: 1K (default) $0.117, 4K $0.234. $0.117 per unit of `num_images`. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.

**Do I need a fal account to use Phota Image Editing in opencode?**

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

**How long does it take to set up Phota Image Editing in opencode?**

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

**Does opencode wait while Phota Image Editing runs?**

Phota Image Editing runs in the background. opencode starts the run, checks on it and gives you the image when it's ready.

**What is Phota best at?**

Phota is built for portraits and scenes where a specific person should remain recognizable. Useful applications include headshots, themed photo sets, campaign images, and storyboards with a recurring cast.

**Why might a Phota portrait look like a different person?**

Phota needs the correct trained profile referenced in the request to preserve a specific person's likeness. Clear profile photos with varied angles and expressions also matter.

**Can Phota keep someone recognizable across different scenes?**

That is Phota's main purpose. A trained profile carries the person's appearance across changes in setting, clothing, and photographic style.

**How should I write a Phota prompt?**

Describe the subject, framing, pose, expression, setting, and lighting. State which details must stay the same, especially when changing an existing composition.

**Can Phota produce 4K images?**

Yes. For these Phota models, choose Nano Banana 2 when requesting 4K output.

