Blog/AiPy × WaveSpeedAI FLUX.1 Kontext MCP: Restore Old Photos Through Chat — Edit Anything, Anywhere

AiPy × WaveSpeedAI FLUX.1 Kontext MCP:Restore Old Photos Through Chat — Edit Anything, Anywhere

Start with the results:

P1-1

P1-2

1. Introducing FLUX.1 Kontext

FLUX.1 Kontext is a professional image-to-image editing model developed by Black Forest Labs, designed for intelligent contextual understanding and precise image manipulation. It supports a wide range of editing tasks without requiring complex prompts, including object modification, style transformation, background replacement, character consistency editing, and text editing.

FLUX.1 Kontext’s core strengths lie in its exceptional contextual understanding and ability to maintain character consistency. It ensures that key elements—such as character features and compositional layouts—remain stable even after multiple rounds of editing.

Additionally, both the** FLUX.1 Kontext Pro** and FLUX.1 Kontext Max versions of the API are now available as paid offerings. Black Forest Labs says it will soon release the open source FLUX.1 Kontext Dev.

2. Introducing WaveSpeed MCP: Empowering Agent Multimodality

WaveSpeedAI is a global leading platform in multimodal AI acceleration, integrating the most advanced AI video and image generation models. We provide efficient, secure, and reliable solutions, empowering developers and enterprises to accelerate creation and commercialization.

Seamless Integration, Enhanced Agent Capabilities

WaveSpeed MCP empowers any agent—such as those built on large language models like DeepSeek—to effortlessly gain image and video generation abilities through a standardized interface, enabling truly multimodal interaction.

Professional-Grade Output Quality

Simplified Development Workflow

Developers don’t need to master the complexities of image and video generation. With simple integration via MCP, agents can be instantly equipped with powerful visual creation capabilities.

Efficient and Reliable

3. Introducing AiPy

AiPy is a practical implementation of Python concepts, demonstrating their value and potential in the real world.

Meet AiPy — your ultimate AI sidekick.

👉 Download here

4. Integrating WaveSpeed MCP into AiPy

This article uses AiPy as an example to demonstrate how to add image and video generation capabilities using WaveSpeed MCP. Before we begin, please make sure you have the following ready:

Open WaveSpeedAI and Log In

Many of you may already be familiar with WaveSpeedAI, the world’s fastest and most cost-effective AI platform for image and video generation.

If you don’t yet have an account, you can apply for one here.

P2

Sign up with GitHub or Google and get $1 instantly.

P3

Get Access Key.

P4

Download the WaveSpeedAI MCP

This is a simple step: just use the MCP service provided by WaveSpeedAI and install the MCP client. If you’re interested in the code, you can read our docs to learn more.

🔗WaveSpeedAI MCP Server

If you’re not yet familiar with MCP, think of it as an AI orchestrator—it coordinates multiple large models and tools to automate complex tasks, enabling AI not just to think, but also to act.

pip install wavespeed-mcp

You can check the version information after installation.

pip show wavespeed-mcp

5. Configuration of AiPy

In AiPy’s configuration directory, create a new file named mcp.json, enter the following content (be sure to replace WAVESPEED_API_KEY), and save it.

{
  "mcpServers": {
    "Wavespeed": {
      "command": "wavespeed-mcp",
      "env": {
        "WAVESPEED_API_KEY": "xxx"
      }
    }
  }

After creating the configuration file, open AiPy and enter the following command to enable the newly created MCP: /mcp enable

This command will list the available MCP services; the first time you run it, there may be a brief loading delay.

P5

6. Start and Try FLUX.1 Kontext

After configuration, enter AiPy commands in the terminal to enable MCP and start chatting with the agent.

Example 1: Restore an AI-generated old photo

Step 1: Use FLUX Dev to generate an old-style image

Prompt:

Use the MCP to generate an old picture, a country boulevard scene, the picture should be a little worn and have a stain in the lower right corner. The final generated image should be displayed in the terminal.

Agent Running Process:

P6

Result:

P7

Tip: Include ‘display the final image in the terminal’ in your prompt.

Step 2: Use FLUX.1 Kontext to test restoration

Prompt:

Restore this old photo by removing the stains around the edges and adding color to the image.

Agent Running Process:

P8

Result:

P9

Example 2: Restore a real old photo

Find an old photo on a website and see what MCP can do.

P10

Place the image at /tmp/oldpicture.png

Prompt:

Please restore the image at /tmp/oldpicture.png — make it high-resolution and in color.

Agent Running Process:

P11

Result:

P12

With just a few simple prompts, you can easily recover damaged old photos.

Below are a few more restoration examples to show the magic of one-click photo repair.

P1-1

P1-2

7. Try FLUX.1 Kontext now!

WaveSpeedAI and Windsurf Agent allow developers to unleash their creativity and complete the highest quality multimodal creations in the least amount of time. Try it now and start creating efficiently!

🔗WaveSpeed MCP Link

🔗AIPY link

If you’re interested in agent integration or evaluation, we warmly invite you to join us.

🔗https://github.com/WaveSpeedAI/agent-mcp-lab

📲 Follow us on Twitter, LinkedIn and join our Discord channel to stay updated.

© 2025 WaveSpeedAI. All rights reserved.