Models / Black Forest Labs
Image

FLUX.1 Kontext [pro]

In-context image generation and editing model with enhanced prompt adherence.

About model

FLUX.1 Kontext [pro] edits images based on text instructions, preserving unmodified regions. It produces high-quality output suited for professional workflows, making it ideal for commercial use. Designed for professionals, it enables targeted edits with precision.

  • API usage

    • cURL
    • Python
    • Typescript

    Endpoint:

    black-forest-labs/FLUX.1-kontext-pro

    curl -X POST "https://api.together.xyz/v1/images/generations" \
      -H "Authorization: Bearer $TOGETHER_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "black-forest-labs/FLUX.1-kontext-pro",
        "prompt": "Draw an anime style version of this image.",
        "width": 1024,
        "height": 768,
        "steps": 28,
        "n": 1,
        "response_format": "url",
        "image_url": "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/yosemite.png"
      }'
    
    from together import Together
    
    client = Together()
    
    imageCompletion = client.images.generate(
        model="black-forest-labs/FLUX.1-kontext-pro",
        width=1024,
        height=768,
        steps=28,
        prompt="Draw an anime style version of this image.",
        image_url="https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/yosemite.png",
    )
    
    print(imageCompletion.data[0].url)
    
    
    
    import Together from "together-ai";
    
    const together = new Together();
    
    async function main() {
      const response = await together.images.create({
        model: "black-forest-labs/FLUX.1-kontext-pro",
        width: 1024,
        height: 1024,
        steps: 28,
        prompt: "Draw an anime style version of this image.",
        image_url: "https://huggingface.co/datasets/patrickvonplaten/random_img/resolve/main/yosemite.png",
      });
    
      console.log(response.data[0].url);
    }
    
    main();
    
    
  • Model card

    FLUX.1 Kontext [pro] is a generative flow matching model designed for fast, iterative image editing and generation workflows. It combines both text and image inputs to deliver local editing, generative in-context modifications, and text-to-image generation capabilities.

    The model excels at targeted edits in specific image regions, complex transformations of entire scenes, and maintaining character consistency across multiple iterations.

    Built for production use cases requiring rapid iteration and professional-quality results with minimal latency between edits.

Related models
  • Model provider
    Black Forest Labs
  • Type
    Image
  • Main use cases
    Image-to-Image
  • Deployment
    Serverless
    On-Demand Dedicated
  • Input price

    $0.04 / MP

  • Input modalities
    Text
    Image
  • Output modalities
    Image