[Integrations](https://spiral.ai/integrations) › [opencode](https://spiral.ai/integrations/opencode) › [Vidu Reference to Image](https://spiral.ai/integrations/opencode/vidu-reference-to-image)

# How to Use Vidu Reference to Image in opencode

Vidu Reference to Image turns reference photos and a written brief into still images with consistent subjects. Use it to compose product scenes, place characters together, or edit objects in an existing picture.

|  |  |
| --- | --- |
| Model | Vidu Reference to Image |
| Available through | fal |
| Category | Image |
| Price | $0.065 per image. |
| Returns | image |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with Vidu Reference to Image in opencode

- Use Vidu Reference to Image with the product photo in this project's assets to create a wide homepage image: the product on a pale stone shelf beside a window, soft morning light, product centered on the right, empty space on the left. Preserve its shape and color.
- Use Vidu Reference to Image with the character references in this project to create a square onboarding illustration. Place both characters beside a workbench, facing each other, and preserve their clothing and facial features.
- Use Vidu Reference to Image with the room photo and chair reference in the project assets. Replace the chair beside the window with the referenced chair, preserve the room layout, and save the result as a design draft.
- Use Vidu Reference to Image with this project's bottle reference to draft three separate campaign images: on a kitchen counter, on a picnic table, and beside a gym bag. Reuse the same reference and preserve the bottle's proportions.
- Use Vidu Reference to Image with the portrait and camera references in this project. Create a wide thumbnail draft showing the person holding the camera on the right, with a plain background and empty space on the left. Save it for review.

## How to set up Vidu Reference to Image 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 Vidu Reference to Image**: 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/vidu/reference-to-image",
    "input": {
      "prompt": "The little devil is looking at the apple on the beach and walking around it.",
      "reference_image_urls": [
        "<reference_image_urls>"
      ]
    }
  }'
```

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

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

## Vidu Reference to Image tools and prices

- [Vidu](https://spiral.ai/tools/fal/fal-ai/vidu/reference-to-image) (fal): $0.065 per image.

## Settings you can ask for

| Setting | Allowed values | Default | Description |
| --- | --- | --- | --- |
| aspect_ratio | 16:9, 9:16, 1:1 | 16:9 | The aspect ratio of the output video |
| seed |  | — | Random seed for generation |

## What can you do with Vidu Reference to Image in opencode?

Create reference-based image assets for a project's pages, demos, and storyboards. A coding agent can use project images and written briefs to prepare compositions and save drafts for review.

### Product lifestyle scenes

Combine a product reference with a setting reference to draft a lifestyle image. Describe the product's placement, lighting, and details to preserve.

### Character scenes for storyboards

Use character references to draft individual storyboard images. Specify each character's position, expression, and relationship to the scene.

### Campaign composition tests

Reuse the same product and person references across different compositions. Compare a close product view, a person holding it, and a wider environmental scene.

### Interior design concepts

Start with a room photo and a furniture reference to explore a replacement piece. Describe its position and the room details that should remain.

### Wardrobe color studies

Use an existing portrait to explore changes to an outfit's color. State which garment should change and which facial and background details to preserve.

### Prop replacements

Replace an object in a source photo using a separate prop reference. Describe the intended scale, placement, and interaction with the person holding it.

### Creator thumbnail drafts

Combine a portrait and an object reference into a thumbnail concept. Specify the expression, subject placement, and empty space for a headline added later.

## Overview

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

## Vidu Reference to Image in other agents

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

## More opencode guides

- [Vidu Q2 Text to Image](https://spiral.ai/integrations/opencode/vidu-q2-text-to-image)
- [Wan 2.2 5B Text to Image](https://spiral.ai/integrations/opencode/wan-2-2-5b-text-to-image)
- [Vidu Q2 Reference to Image](https://spiral.ai/integrations/opencode/vidu-q2-reference-to-image)
- [Wan 2.2 A14B Image to Image](https://spiral.ai/integrations/opencode/wan-2-2-a14b-image-to-image)
- [Topaz Upscale Precision](https://spiral.ai/integrations/opencode/topaz-upscale-precision)
- [Wan 2.2 A14B Text to Image](https://spiral.ai/integrations/opencode/wan-2-2-a14b-text-to-image)

## Questions about Vidu Reference to Image in opencode

**Can opencode use Vidu Reference to Image?**

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

**How much does Vidu Reference to Image cost in opencode?**

$0.065 per image. 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 Vidu Reference to Image in opencode?**

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

**How long does it take to set up Vidu Reference to Image in opencode?**

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

**Does opencode wait while Vidu Reference to Image runs?**

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

**What is Vidu Reference to Image useful for?**

Use it when an existing person, character, or product needs to appear in a newly composed still image. Reference images guide appearance, while your prompt describes the result.

**Can Vidu Reference to Image combine several pictures?**

Yes. The original reference-to-image model supports one to seven reference images, allowing you to bring separately photographed subjects into one composition.

**How should I write a Vidu Reference to Image prompt?**

Describe the scene, style, composition, and details to preserve. Keep the generation prompt within 1,500 characters, and make each reference's intended role clear.

**Can Vidu Reference to Image change an existing photo?**

Yes. Its editing capabilities include adding objects, replacing objects, changing part of an object's appearance, and combining multiple images.

**Does Vidu Reference to Image animate the references?**

It produces a still image. Use it for the composition or edited picture you want to create.

