# Create Predictions - General 

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /replicate/v1/models/{models}/predictions:
    post:
      summary: 'Create Predictions - General '
      deprecated: false
      description: >+
        ## Overview


        The Replicate Predictions API provides the ability to generate
        high-quality images using various FLUX models from Black Forest Labs
        through the standard Replicate format. The API supports a comprehensive
        range of FLUX model variants, each optimized for different use cases,
        from rapid prototyping to professional-grade image generation. Users can
        seamlessly switch between different models by simply changing the model
        name in the URL path, making it flexible for various creative and
        commercial applications. The API offers extensive customization options
        including aspect ratio control, output format selection, quality
        settings, and advanced generation parameters to fine-tune the image
        creation process.


        Due to significant differences in parameter lists across models, please
        refer to the [Replicate official
        documentation](https://replicate.com/black-forest-labs) for more
        information.


        ⚠️ **Parameter Format Note**: We are compatible with Replicate's
        parameter format, but all parameters must be placed within the `input`
        object. For specific parameters supported by each model, please refer to
        the corresponding official model page (e.g.,
        [flux-2-pro](https://replicate.com/black-forest-labs/flux-2-pro?input=json)).


        **Example**:

        ```json

        {
          "input": {
            "prompt": "your prompt here",
            "resolution": "1 MP",
            "aspect_ratio": "1:1",
            "output_format": "webp",
            "output_quality": 80,
            "safety_tolerance": 2
          }
        }

        ```


        ---


        If you want to retrieve the generated results later, you can use the
        `id` returned by this API through the [query
        endpoint](https://apidoc.cometapi.com/image/replicate/query) to get the
        relevant content.



        ### Supported Models

        - `black-forest-labs/flux-2-max`

        - `black-forest-labs/flux-2-pro`

        - `black-forest-labs/flux-2-dev`

        - `black-forest-labs/flux-2-flex`

        - `black-forest-labs/flux-kontext-max`

        - `black-forest-labs/flux-kontext-pro`

        - `black-forest-labs/flux-schnell`

        - `black-forest-labs/flux-pro`

        - `black-forest-labs/flux-dev`

        - `black-forest-labs/flux-1.1-pro-ultra`

        - `black-forest-labs/flux-1.1-pro`



        ---


        ## FAQ


        ### ⚠️ Image Reference Support


        **Issue**: Not all FLUX models support image reference functionality


        **Solution**: Only the flux-kontext model series (flux-kontext-max and
        flux-kontext-pro) supports the `input_image` parameter for referencing
        existing images. Other FLUX models do not support this feature and can
        only generate images based on text prompts.

      operationId: createPrediction
      tags:
        - 🖼️ Image Models/Replicate(image)
        - Replicate
      parameters:
        - name: models
          in: path
          description: ''
          required: true
          example: black-forest-labs/flux-pro
          schema:
            type: string
            enum:
              - black-forest-labs/flux-kontext-max
              - black-forest-labs/flux-kontext-pro
              - black-forest-labs/flux-schnell
              - black-forest-labs/flux-pro
              - black-forest-labs/flux-dev
              - black-forest-labs/flux-1.1-pro-ultra
              - black-forest-labs/flux-1.1-pro
              - black-forest-labs/flux-2-flex
              - black-forest-labs/flux-2-pro
              - black-forest-labs/flux-2-dev
            x-apidog-enum:
              - value: black-forest-labs/flux-kontext-max
                name: ''
                description: ''
              - value: black-forest-labs/flux-kontext-pro
                name: ''
                description: ''
              - value: black-forest-labs/flux-schnell
                name: ''
                description: ''
              - value: black-forest-labs/flux-pro
                name: ''
                description: ''
              - value: black-forest-labs/flux-dev
                name: ''
                description: ''
              - value: black-forest-labs/flux-1.1-pro-ultra
                name: ''
                description: ''
              - value: black-forest-labs/flux-1.1-pro
                name: ''
                description: ''
              - value: black-forest-labs/flux-2-flex
                name: ''
                description: ''
              - value: black-forest-labs/flux-2-pro
                name: ''
                description: ''
              - value: black-forest-labs/flux-2-dev
                name: ''
                description: ''
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer {{api-key}}
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                input:
                  type: object
                  properties:
                    prompt:
                      type: string
                    go_fast:
                      type: boolean
                    guidance:
                      type: number
                    megapixels:
                      type: string
                    num_outputs:
                      type: integer
                    aspect_ratio:
                      type: string
                    output_format:
                      type: string
                    output_quality:
                      type: integer
                    prompt_strength:
                      type: number
                    num_inference_steps:
                      type: integer
                  required:
                    - prompt
                    - go_fast
                    - guidance
                    - megapixels
                    - num_outputs
                    - aspect_ratio
                    - output_format
                    - output_quality
                    - prompt_strength
                    - num_inference_steps
                  x-apidog-orders:
                    - prompt
                    - go_fast
                    - guidance
                    - megapixels
                    - num_outputs
                    - aspect_ratio
                    - output_format
                    - output_quality
                    - prompt_strength
                    - num_inference_steps
              required:
                - input
              x-apidog-orders:
                - input
            examples:
              '1':
                value:
                  input:
                    prompt: Merge images and return the main subject within the image.
                    input_images:
                      - >-
                        https://replicate.delivery/xezq/Q9jOVfT4nmT6YaUGe7fwMe85kYPNziFq18j850Sg6YvPlk0WB/tmpzq6ncmxa.jpg
                      - >-
                        https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg
                    output_format: jpg
                    aspect_ratio: '16:9'
                summary: black-forest-labs/flux-kontext-max
              '2':
                value:
                  input:
                    prompt: Merge images and return the main subject within the image.
                    input_images:
                      - >-
                        https://replicate.delivery/xezq/Q9jOVfT4nmT6YaUGe7fwMe85kYPNziFq18j850Sg6YvPlk0WB/tmpzq6ncmxa.jpg
                      - >-
                        https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg
                    output_format: jpg
                    aspect_ratio: '16:9'
                summary: black-forest-labs/flux-kontext-pro
              '3':
                value:
                  input:
                    prompt: >-
                      black forest gateau cake spelling out the words "FLUX
                      SCHNELL", tasty, food photography, dynamic shot
                    input_image: >-
                      https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                    output_format: jpg
                    aspect_ratio: '16:9'
                    output_quality: 80
                    safety_tolerance: 2
                    prompt_upsampling: true
                summary: black-forest-labs/flux-schnell
              '4':
                value:
                  input:
                    prompt: >-
                      black forest gateau cake spelling out the words "FLUX
                      SCHNELL", tasty, food photography, dynamic shot
                    input_image: >-
                      https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                    output_format: jpg
                    aspect_ratio: '16:9'
                    output_quality: 80
                    safety_tolerance: 2
                    prompt_upsampling: true
                summary: black-forest-labs/flux-pro
              '5':
                value:
                  input:
                    prompt: >-
                      black forest gateau cake spelling out the words "FLUX
                      SCHNELL", tasty, food photography, dynamic shot
                    input_image: >-
                      https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                    output_format: jpg
                    aspect_ratio: '16:9'
                    output_quality: 80
                    safety_tolerance: 2
                    prompt_upsampling: true
                summary: black-forest-labs/flux-dev
              '6':
                value:
                  input:
                    raw: false
                    prompt: >-
                      a majestic snow-capped mountain peak bathed in a warm glow
                      of the setting sun
                    aspect_ratio: '3:2'
                    output_format: jpg
                    safety_tolerance: 2
                    image_prompt_strength: 0.1
                summary: black-forest-labs/flux-1.1-pro-ultra
              '7':
                value:
                  input:
                    raw: false
                    prompt: >-
                      a majestic snow-capped mountain peak bathed in a warm glow
                      of the setting sun
                    aspect_ratio: '3:2'
                    output_format: jpg
                    safety_tolerance: 2
                    image_prompt_strength: 0.1
                summary: black-forest-labs/flux-1.1-pro
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    description: Unique identifier for the prediction task
                    type: string
                  model:
                    description: Name and version of the AI model used
                    type: string
                  version:
                    description: Specific version ID of the AI model used
                    type: string
                  input:
                    type: object
                    properties:
                      prompt:
                        type: string
                        description: Text prompt provided by the user
                    required:
                      - prompt
                    description: Parameters input to the model
                    x-apidog-orders:
                      - prompt
                  logs:
                    description: Log information output by the model during processing
                    type: string
                  output:
                    type: array
                    items:
                      type: string
                    description: Output results generated by the model
                  data_removed:
                    description: >-
                      Indicates whether input or output data has been removed
                      due to privacy or other reasons
                    type: boolean
                  error:
                    description: >-
                      Contains error information if an error occurred during
                      task execution
                    type: 'null'
                  status:
                    type: string
                    description: Current status of the prediction task
                  created_at:
                    description: Timestamp when the prediction task was created
                    type: string
                  urls:
                    type: object
                    properties:
                      cancel:
                        description: API endpoint URL for canceling this prediction task
                        type: string
                      get:
                        description: >-
                          API endpoint URL for getting the current status and
                          results of this prediction task
                        type: string
                      stream:
                        description: >-
                          URL for streaming output if the model supports
                          streaming
                        type: string
                    required:
                      - cancel
                      - get
                      - stream
                    description: API endpoint URLs related to this prediction task
                    x-apidog-orders:
                      - cancel
                      - get
                      - stream
                required:
                  - id
                  - model
                  - version
                  - input
                  - logs
                  - output
                  - data_removed
                  - error
                  - status
                  - created_at
                  - urls
                x-apidog-orders:
                  - id
                  - model
                  - version
                  - input
                  - logs
                  - output
                  - data_removed
                  - error
                  - status
                  - created_at
                  - urls
              examples:
                '1':
                  summary: black-forest-labs/flux-kontext-max
                  value:
                    id: k31cbm70fdrm80ctg73s0zcwgc
                    model: black-forest-labs/flux-kontext-max
                    version: hidden
                    input:
                      aspect_ratio: '16:9'
                      input_image: >-
                        https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg
                      input_image_2: >-
                        https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                      input_image_3: >-
                        https://filesystem.site/cdn/20250414/chxiLc2O45zoLT8BCrQ6WQlTvGDDnK.png
                      input_image_4: >-
                        https://filesystem.site/cdn/20250414/chxiLc2O45zoLT8BCrQ6WQlTvGDDnK.png
                      output_format: jpg
                      prompt: >-
                        black forest gateau cake spelling out the words "FLUX
                        SCHNELL", tasty, food photography, dynamic shot
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T09:52:31.355Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/k31cbm70fdrm80ctg73s0zcwgc/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/k31cbm70fdrm80ctg73s0zcwgc
                      stream: >-
                        https://stream.replicate.com/v1/files/bcwr-xbztqryuzofyta6vb5yrmcarksz7rsfopeykdcloxinsrjqad5aq
                      web: https://replicate.com/p/k31cbm70fdrm80ctg73s0zcwgc
                '2':
                  summary: black-forest-labs/flux-kontext-pro
                  value:
                    id: v4ddj1t9qhrma0ctg758tynjj8
                    model: black-forest-labs/flux-kontext-pro
                    version: hidden
                    input:
                      aspect_ratio: '16:9'
                      input_image: >-
                        https://h2.inkwai.com/bs2/upload-ylab-stunt/se/ai_portal_queue_mmu_image_upscale_aiweb/3214b798-e1b4-4b00-b7af-72b5b0417420_raw_image_0.jpg
                      input_image_2: >-
                        https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                      input_image_3: >-
                        https://filesystem.site/cdn/20250414/chxiLc2O45zoLT8BCrQ6WQlTvGDDnK.png
                      input_image_4: >-
                        https://filesystem.site/cdn/20250414/chxiLc2O45zoLT8BCrQ6WQlTvGDDnK.png
                      output_format: jpg
                      prompt: >-
                        black forest gateau cake spelling out the words "FLUX
                        SCHNELL", tasty, food photography, dynamic shot
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T09:55:09.372Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/v4ddj1t9qhrma0ctg758tynjj8/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/v4ddj1t9qhrma0ctg758tynjj8
                      stream: >-
                        https://stream.replicate.com/v1/files/bcwr-65pn3kan2oikf6jwavnevkg6edd56ljnlich3hwl53jjlod5dtja
                      web: https://replicate.com/p/v4ddj1t9qhrma0ctg758tynjj8
                '3':
                  summary: black-forest-labs/flux-schnell
                  value:
                    id: 7yh95khsa5rnr0ctg7b8v8fzs0
                    model: black-forest-labs/flux-schnell
                    version: hidden
                    input:
                      aspect_ratio: '16:9'
                      input_image: >-
                        https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                      output_format: jpg
                      output_quality: 80
                      prompt: >-
                        black forest gateau cake spelling out the words "FLUX
                        SCHNELL", tasty, food photography, dynamic shot
                      prompt_upsampling: true
                      safety_tolerance: 2
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T10:08:11.601Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/7yh95khsa5rnr0ctg7b8v8fzs0/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/7yh95khsa5rnr0ctg7b8v8fzs0
                      stream: >-
                        https://stream.replicate.com/v1/files/nwql-vi34h3xvazexs4fbgaldczexidvfrewomwv2iplv7c6s4e2lrnnq
                      web: https://replicate.com/p/7yh95khsa5rnr0ctg7b8v8fzs0
                '4':
                  summary: black-forest-labs/flux-pro
                  value:
                    id: t2s87bgf3drme0ctg7btagrmcr
                    model: black-forest-labs/flux-pro
                    version: hidden
                    input:
                      aspect_ratio: '16:9'
                      input_image: >-
                        https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                      output_format: jpg
                      output_quality: 80
                      prompt: >-
                        black forest gateau cake spelling out the words "FLUX
                        SCHNELL", tasty, food photography, dynamic shot
                      prompt_upsampling: true
                      safety_tolerance: 2
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T10:09:06.331Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/t2s87bgf3drme0ctg7btagrmcr/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/t2s87bgf3drme0ctg7btagrmcr
                      stream: >-
                        https://stream.replicate.com/v1/files/bcwr-bwrjm675gy4qfd2aiccw3mkqjnvjopol3ebnpjjfyhet3a637vya
                      web: https://replicate.com/p/t2s87bgf3drme0ctg7btagrmcr
                '5':
                  summary: black-forest-labs/flux-dev
                  value:
                    id: ya5ybp98n5rma0ctg7f9289j0w
                    model: black-forest-labs/flux-dev
                    version: hidden
                    input:
                      aspect_ratio: '16:9'
                      input_image: >-
                        https://replicate.delivery/xezq/XfwWjHJ7HfrmXE6ukuLVEpXWfeQ3PQeRI5mApuLXRxST7XMmC/tmpc91tlq20.png
                      output_format: jpg
                      output_quality: 80
                      prompt: >-
                        black forest gateau cake spelling out the words "FLUX
                        SCHNELL", tasty, food photography, dynamic shot
                      prompt_upsampling: true
                      safety_tolerance: 2
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T10:16:51.625Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/ya5ybp98n5rma0ctg7f9289j0w/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/ya5ybp98n5rma0ctg7f9289j0w
                      stream: >-
                        https://stream.replicate.com/v1/files/bcwr-qzx2c7k2mr3tte2ikduom767hwzzj5k2uxgtl7xodbo2xqpqp3ya
                      web: https://replicate.com/p/ya5ybp98n5rma0ctg7f9289j0w
                '6':
                  summary: black-forest-labs/flux-1.1-pro-ultra
                  value:
                    id: r5eny62h2srma0ctg7fsm3zaec
                    model: black-forest-labs/flux-1.1-pro-ultra
                    version: hidden
                    input:
                      aspect_ratio: '3:2'
                      image_prompt_strength: 0.1
                      output_format: jpg
                      prompt: >-
                        a majestic snow-capped mountain peak bathed in a warm
                        glow of the setting sun
                      raw: false
                      safety_tolerance: 2
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T10:18:07.51Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/r5eny62h2srma0ctg7fsm3zaec/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/r5eny62h2srma0ctg7fsm3zaec
                      stream: >-
                        https://stream.replicate.com/v1/files/bcwr-azlfhot4ahksdqnor7xrtdv3gwxfl7eha3uarkmccl5ke77b46iq
                      web: https://replicate.com/p/r5eny62h2srma0ctg7fsm3zaec
                '7':
                  summary: black-forest-labs/flux-1.1-pro
                  value:
                    id: f40hb0fjysrm80ctg7ftfsqv7g
                    model: black-forest-labs/flux-1.1-pro
                    version: hidden
                    input:
                      aspect_ratio: '3:2'
                      image_prompt_strength: 0.1
                      output_format: jpg
                      prompt: >-
                        a majestic snow-capped mountain peak bathed in a warm
                        glow of the setting sun
                      raw: false
                      safety_tolerance: 2
                    logs: ''
                    output: null
                    data_removed: false
                    error: null
                    source: api
                    status: starting
                    created_at: '2025-11-14T10:18:48.95Z'
                    urls:
                      cancel: >-
                        https://api.replicate.com/v1/predictions/f40hb0fjysrm80ctg7ftfsqv7g/cancel
                      get: >-
                        https://api.replicate.com/v1/predictions/f40hb0fjysrm80ctg7ftfsqv7g
                      stream: >-
                        https://stream.replicate.com/v1/files/bcwr-ge2rpknnxjzeatiq4ghj47vvb5t3lnukxtknj6ywcxj2vwimsrya
                      web: https://replicate.com/p/f40hb0fjysrm80ctg7ftfsqv7g
          headers: {}
          x-apidog-name: OK
      security: []
      x-apidog-folder: 🖼️ Image Models/Replicate(image)
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/810968/apis/api-18941522-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://api.cometapi.com
    description: Prod Env
security: []

```
