README.md 1.22 KB
Newer Older
1
2
# Nunchaku INT4 FLUX.1 Depth/Canny-to-Image Demo

3
![demo](https://huggingface.co/mit-han-lab/nunchaku-artifacts/resolve/main/nunchaku/app/flux.1/depth_canny/assets/demo.jpg)
4
5
6
7
8

This interactive Gradio application transforms your uploaded image into a different style based on a text prompt. The generated image preserves either the depth map or Canny edge of the original image, depending on the selected model.

The base models are:

9
10
- [FLUX.1-Depth-dev](https://huggingface.co/black-forest-labs/FLUX.1-Depth-dev) (preserves depth map)
- [FLUX.1-Canny-dev](https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev) (preserves Canny edge)
11

muyangli's avatar
muyangli committed
12
13
14
15
First you need to install some dependencies:

```shell
pip install git+https://github.com/asomoza/image_gen_aux.git
muyangli's avatar
muyangli committed
16
pip install controlnet_aux mediapipe
muyangli's avatar
muyangli committed
17
18
19
```

Then run:
20
21
22
23
24

```shell
python run_gradio.py
```

25
26
27
28
- By default, the model is `FLUX.1-Depth-dev`. You can add `-m canny` to switch to `FLUX.1-Canny-dev`.
- The demo loads the Gemma-2B model as a safety checker by default. To disable this feature, use `--no-safety-checker`.
- To further reduce GPU memory usage, you can enable the W4A16 text encoder by specifying `--use-qencoder`.
- By default, we use our INT4 model. Use `-p bf16` to switch to the BF16 model.