priv/docs/workers_ai_text_to_image.md

# Workers AI Text To Image

## Execute @cf/black-forest-labs/flux-1-schnell model.

**POST** `/accounts/{account_id}/ai/run/@cf/black-forest-labs/flux-1-schnell`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/black-forest-labs/flux-2-dev model.

**POST** `/accounts/{account_id}/ai/run/@cf/black-forest-labs/flux-2-dev`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/black-forest-labs/flux-2-klein-4b model.

**POST** `/accounts/{account_id}/ai/run/@cf/black-forest-labs/flux-2-klein-4b`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/black-forest-labs/flux-2-klein-9b model.

**POST** `/accounts/{account_id}/ai/run/@cf/black-forest-labs/flux-2-klein-9b`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/bytedance/stable-diffusion-xl-lightning model.

**POST** `/accounts/{account_id}/ai/run/@cf/bytedance/stable-diffusion-xl-lightning`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/leonardo/lucid-origin model.

**POST** `/accounts/{account_id}/ai/run/@cf/leonardo/lucid-origin`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/leonardo/phoenix-1.0 model.

**POST** `/accounts/{account_id}/ai/run/@cf/leonardo/phoenix-1.0`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/lykon/dreamshaper-8-lcm model.

**POST** `/accounts/{account_id}/ai/run/@cf/lykon/dreamshaper-8-lcm`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/runwayml/stable-diffusion-v1-5-img2img model.

**POST** `/accounts/{account_id}/ai/run/@cf/runwayml/stable-diffusion-v1-5-img2img`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/runwayml/stable-diffusion-v1-5-inpainting model.

**POST** `/accounts/{account_id}/ai/run/@cf/runwayml/stable-diffusion-v1-5-inpainting`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Execute @cf/stabilityai/stable-diffusion-xl-base-1.0 model.

**POST** `/accounts/{account_id}/ai/run/@cf/stabilityai/stable-diffusion-xl-base-1.0`



### Responses

#### 200 Object with user data.

> Data is at `body["result"]`

```json
{}
```

#### 400 Bad request

```json
{
  "errors": [
    {
      "code": "*string*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```



## Open Websocket connection with @cf/sven/test-pipe-http model.

**GET** `/accounts/{account_id}/ai/run/@cf/sven/test-pipe-http`



### Responses

#### 101 Returns a websocket connection

```json

```

#### 400 Bad Request

```json
{
  "errors": [
    {
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}
```