How to Use Kling Image 4.0 Image to Image in opencode
Use Kling Image 4.0 Image to Image to restyle a reference, revise a poster, or put a product into a new scene. Unlike Kling Image 4.0 Text to Image, it uses supplied images to guide appearance and composition.
Prompts to try with Kling Image 4.0 Image to Image in opencode
Copy an example into opencode, or ask in your own words.
Use Kling Image 4.0 Image to Image with the product photo in this project's assets. Create a 4K square kitchen scene with soft window light; preserve the product's shape, material, and logo.
Use Kling Image 4.0 Image to Image to revise the event poster in the project's assets using the approved copy in the content file. Preserve the illustration and layout, replace only the headline and date, and produce a 4K portrait image for review.
Generate a product photo with Kling Image 4.0 Image to Image: a matte black water bottle on wet slate, soft morning light, 1:1. Tell me the price first. Save the result in ./assets.
Make four logo concepts for a coffee brand called "Northline" with Kling Image 4.0 Image to Image.
Create a 16:9 hero image of a quiet mountain cabin at dusk with Kling Image 4.0 Image to Image.
How to set up Kling Image 4.0 Image to Image in opencode
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- 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.
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
- 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.
opencode mcp auth spiral
- Check it
Spiral shows as connected.
opencode mcp list
Use the Spiral skill
- Send opencode 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 Kling Image 4.0 Image to Image
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": "kling/v4/image-to-image", "input": { "prompt": "Turn @Image1 into a photorealistic product render.", "image_urls": [ "<image_urls>" ] } }'
Then paste one of the prompts above: opencode finds Kling Image 4.0 Image to Image on Spiral, shows the price and runs it.
Kling Image 4.0 Image to Image providers and prices
Spiral runs Kling Image 4.0 Image to Image through fal. Open a card for today's price, with every fee included.
Up to $0.085995 per run at the default inputs. result_type: single (default) $0.085995, series $0.331695. Each item in image_urls adds $0.004095.
Settings you can ask for
Kling Image 4.0 Image to Image works from your prompt and image URLs. Ask opencode for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Result type | single or series | single | 'single' returns independent images; 'series' returns a coherent set of related images. |
| Number of images | 1 to 9 | 1 | Number of independent images to generate (1-9). Only used when result_type is 'single'. |
| Resolution | 2K, 4K, or 8K | 2K | Output resolution. |
| Aspect ratio | auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3 and 1 more | auto | Aspect ratio of generated images. 'auto' picks one from the input content. |
Every API field of Kling Image 4.0 · Image Editing is on its tool page: open its card above.
What can you do with Kling Image 4.0 Image to Image in opencode?
Turn project briefs into product imagery, campaign artwork, and storyboard drafts with Kling Image 4.0. Use the project's approved copy and visual direction to make the output specific to the work.
Product campaign images
Develop coordinated product scenes with a shared palette, material treatment, and lighting direction. Give each image a different purpose, such as a hero composition, detail view, or lifestyle scene.
Film storyboards
Plan a scene as an ordered visual sequence. Specify the action and camera framing for each image, plus the character details that should carry through.
Event posters
Combine a main visual with an exact headline, date, and venue. Describe the text hierarchy and placement, then proofread the rendered details.
Presentation graphics
Develop a coordinated set of slide images with consistent colors and typography. Provide the approved message and visual purpose of each slide.
Portrait concepts
Explore a photographic direction through clothing, expression, pose, setting, and light. Describe skin and fabric textures along with the mood.
Multilingual campaign artwork
Develop posters or promotional graphics using approved copy in Kling's documented languages. Keep the composition consistent and check every rendered translation against the supplied wording.
Reference-based editorial revisions
Revise the clothing, background, or headline in an existing cover image. State which features, composition, and text must remain unchanged.
More on Kling Image 4.0 Image to Image and opencode
Overview
Kling Image 4.0 Image to Image in other agents
Questions about Kling Image 4.0 Image to Image in opencode
Can opencode use Kling Image 4.0 Image to Image?
Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Kling Image 4.0 Image to Image like any built-in tool.
How much does Kling Image 4.0 Image to Image cost in opencode?
Up to $0.085995 per run at the default inputs. `result_type`: single (default) $0.085995, series $0.331695. $0.0819 per unit of `num_images`. Each item in `image_urls` adds $0.004095. 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 Kling Image 4.0 Image to Image in opencode?
No. Spiral runs Kling Image 4.0 Image 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 Kling Image 4.0 Image to Image in opencode?
About two minutes: add the server, then sign in, then check it.
Does opencode wait while Kling Image 4.0 Image to Image runs?
Kling Image 4.0 Image to Image runs in the background. opencode starts the run, checks on it and gives you the image when it's ready.
What is Kling Image 4.0 good at?
Its documented strengths are photographic lighting and textures, text within designed images, and coordinated visual sequences. Useful projects include product imagery, posters, storyboards, and presentation graphics.
Can I trust the text in a generated image?
Kling specifies up to 2,000 characters per image, but quality varies with language, font, text density, and layout. Proofread names, numbers, punctuation, and small print before publishing.
Which languages can appear in the images?
Kling documents English, Simplified Chinese, Traditional Chinese, Japanese, Korean, Spanish, and Portuguese. Put the exact wording you want in quotation marks.
How do I keep a storyboard visually consistent?
Request a coordinated series and describe what each image should show. Repeat the character description, clothing, palette, and visual style as requirements for the entire sequence.
When is 8K useful?
Consider 8K when you need room to crop or inspect fine textures in a large image. Kling describes native 8K as preserving details such as hair, skin, and leather grain.
Start using Kling Image 4.0 Image to Image in opencode
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into opencode:
set up https://spiral.ai/SKILL.md


