# Control Light

> ControlLight is a LoRA fine-tune of FLUX.2 [klein] 9B that enhances low-light images while preserving scene structure and fine details, with a single alpha parameter that gives continuous control over enhancement strength from subtle to full brightening.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/control-light`
- **Model ID**: `fal-ai/control-light`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: stylized, transform



## Pricing

- **Price**: $0.03 per megapixels

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`image_url`** (`string`, _required_):
  URL of the low-light input image to enhance.
  - Examples: "https://v3b.fal.media/files/b/0a9be5e2/6SUJmL4nvMUZi4M4UyK1s_f0cb8034-3c86-4c16-8eb5-eee7503c16af.png"

- **`lighting_level`** (`float`, _optional_):
  Strength of the lighting enhancement dial (alpha). 0.0 leaves the image essentially untouched; 1.0 applies the strongest exposure lift the LoRA was trained for. Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`prompt`** (`string`, _optional_):
  Restoration prompt fed to FLUX.2-klein. Default value: `"Enhance this low-light image by lifting exposure and recovering visible details while preserving identity, geometry, atmosphere, natural colors, and avoiding halos, noise, over-sharpening, or overexposure."`
  - Default: `"Enhance this low-light image by lifting exposure and recovering visible details while preserving identity, geometry, atmosphere, natural colors, and avoiding halos, noise, over-sharpening, or overexposure."`

- **`num_inference_steps`** (`integer`, _optional_):
  Number of denoising steps. Default value: `20`
  - Default: `20`
  - Range: `1` to `50`

- **`guidance_scale`** (`float`, _optional_):
  Classifier-free guidance scale. Default value: `1`
  - Default: `1`
  - Range: `0` to `20`

- **`seed`** (`integer`, _optional_):
  Random seed for reproducible generation. If not set, a random seed is used.

- **`sync_mode`** (`boolean`, _optional_):
  If True, return the image as a data URI instead of a CDN URL.
  - Default: `false`

- **`enable_safety_checker`** (`boolean`, _optional_):
  Enable the safety checker for the output image. Default value: `true`
  - Default: `true`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  Output image format. Default value: `"png"`
  - Default: `"png"`
  - Options: `"jpeg"`, `"png"`, `"webp"`



**Required Parameters Example**:

```json
{
  "image_url": "https://v3b.fal.media/files/b/0a9be5e2/6SUJmL4nvMUZi4M4UyK1s_f0cb8034-3c86-4c16-8eb5-eee7503c16af.png"
}
```

**Full Example**:

```json
{
  "image_url": "https://v3b.fal.media/files/b/0a9be5e2/6SUJmL4nvMUZi4M4UyK1s_f0cb8034-3c86-4c16-8eb5-eee7503c16af.png",
  "lighting_level": 0.5,
  "prompt": "Enhance this low-light image by lifting exposure and recovering visible details while preserving identity, geometry, atmosphere, natural colors, and avoiding halos, noise, over-sharpening, or overexposure.",
  "num_inference_steps": 20,
  "guidance_scale": 1,
  "enable_safety_checker": true,
  "output_format": "png"
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`ImageFile`, _required_):
  The enhanced image.
  - Examples: {"content_type":"image/png","height":1360,"url":"https://v3b.fal.media/files/b/0a9be5e5/Hc8GFTr6W5i7iITqfBLXQ_jEMONTDu.png","width":768}

- **`timings`** (`Timings`, _optional_):
  Timing breakdown (seconds).

- **`seed`** (`integer`, _required_):
  The seed used for generation.



**Example Response**:

```json
{
  "image": {
    "content_type": "image/png",
    "height": 1360,
    "url": "https://v3b.fal.media/files/b/0a9be5e5/Hc8GFTr6W5i7iITqfBLXQ_jEMONTDu.png",
    "width": 768
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/control-light \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://v3b.fal.media/files/b/0a9be5e2/6SUJmL4nvMUZi4M4UyK1s_f0cb8034-3c86-4c16-8eb5-eee7503c16af.png"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/control-light",
    arguments={
        "image_url": "https://v3b.fal.media/files/b/0a9be5e2/6SUJmL4nvMUZi4M4UyK1s_f0cb8034-3c86-4c16-8eb5-eee7503c16af.png"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/control-light", {
  input: {
    image_url: "https://v3b.fal.media/files/b/0a9be5e2/6SUJmL4nvMUZi4M4UyK1s_f0cb8034-3c86-4c16-8eb5-eee7503c16af.png"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/control-light)
- [API Documentation](https://fal.ai/models/fal-ai/control-light/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/control-light)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
