You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/public_cloud/ai_machine_learning/deploy_tuto_19_flux/guide.en-gb.md
+27-25Lines changed: 27 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: AI Deploy - Tutorial - Deploy FLUX Text-to-Image Models
3
3
excerpt: How to deploy the FLUX image generation models using ComfyUI
4
-
updated: 2025-07-25
4
+
updated: 2025-07-31
5
5
---
6
6
7
7
> [!primary]
@@ -11,9 +11,9 @@ updated: 2025-07-25
11
11
12
12
## Introduction
13
13
14
-
[FLUX](https://github.com/black-forest-labs/flux) is a flexible family of generative models developed by [Black Forest Technologies](https://bfl.ai/). The **FLUX** models support a variety of tasks, including text-to-image generation, structural conditioning, and inpainting.
14
+
[FLUX](https://github.com/black-forest-labs/flux){.external} is a flexible family of generative models developed by [Black Forest Technologies](https://bfl.ai/){.external}. The **FLUX** models support a variety of tasks, including text-to-image generation, structural conditioning, and inpainting.
15
15
16
-
In this tutorial, we walk through the process of deploying **FLUX** models on **AI Deploy**. We will show how to use **FLUX** models interactively with [ComfyUI](https://github.com/comfyanonymous/ComfyUI) (a visual programming interface).
16
+
In this tutorial, we walk through the process of deploying **FLUX** models on **AI Deploy**. We will show how to use **FLUX** models interactively with [ComfyUI](https://github.com/comfyanonymous/ComfyUI){.external} (a visual programming interface).
17
17
18
18
## Instructions
19
19
@@ -37,7 +37,7 @@ The following table lists the main FLUX variants and their intended use cases:
37
37
|`FLUX.1 [dev]`|[Text to Image](docs/text-to-image.md)|https://huggingface.co/black-forest-labs/FLUX.1-dev|[FLUX.1-dev Non-Commercial License](model_licenses/LICENSE-FLUX1-dev)|
Full list is available on the [official repository](https://github.com/black-forest-labs/flux) for FLUX.1 models.
40
+
Full list is available on the [official repository](https://github.com/black-forest-labs/flux){.external} for FLUX.1 models.
41
41
42
42
## Requirements
43
43
@@ -47,7 +47,7 @@ Before proceeding, ensure you have the following:
47
47
- An AI Deploy Project created inside a [Public Cloud project](/links/public-cloud/public-cloud) in your OVHcloud account
48
48
- A [user for AI Training & Object Storage](/pages/public_cloud/ai_machine_learning/gi_01_manage_users)
49
49
-[The OVHcloud AI CLI](/pages/public_cloud/ai_machine_learning/cli_10_howto_install_cli) installed on your computer
50
-
-[Docker](https://www.docker.com/get-started) installed on your computer, **or** access to a Debian Docker Instance, which is available on the [Public Cloud](/links/manager)
50
+
-[Docker](https://www.docker.com/get-started){.external} installed on your computer, **or** access to a Debian Docker Instance, which is available on the [Public Cloud](/links/manager)
51
51
- A Hugging Face account, with access to the FLUX model. You need to accept usage terms on the model Hugging Face page.
52
52
- A Hugging Face access token (generate one under your Hugging Face account → Access Tokens). This one will be used to authenticate and download the model weights.
53
53
@@ -140,7 +140,7 @@ This command will:
140
140
141
141
You can track the progress of your job using the following commands:
142
142
143
-
```
143
+
```sh
144
144
ovhai job list
145
145
ovhai job logs -f <job_id>
146
146
```
@@ -149,13 +149,13 @@ This will allow you to view the logs generated by your job, seeing the imports a
149
149
150
150
You can then verify the presence of your files by checking your Object Storage bucket from the OVHcloud Control Panel or via CLI using the following command:
151
151
152
-
```console
152
+
```sh
153
153
ovhai bucket object list <bucket_name>@GRA
154
154
```
155
155
156
156
### Build a Docker image
157
157
158
-
Once the FLUX model weights are uploaded to Object Storage, the next step is to build a Docker image that packages [ComfyUI](https://github.com/comfyanonymous/ComfyUI) and its required dependencies.
158
+
Once the FLUX model weights are uploaded to Object Storage, the next step is to build a Docker image that packages [ComfyUI](https://github.com/comfyanonymous/ComfyUI){.external} and its required dependencies.
159
159
160
160
This image will later be deployed as an AI Deploy application, where the model files will be mounted at runtime from Object Storage. This avoids the need to embed large model weights directly into the container image.
Then, launch one of the following commands from the created folder that contain your `Dockerfile` and the `entrypoint.sh` script to build your application image:
243
243
244
-
```console
244
+
```sh
245
245
# Build the image using your machine's default architecture
After building the image, tag and push it to a container registry.
260
260
261
-
In this example, we use the OVHcloud shared registry, available to every AI Deploy user. But you can also use other registires such as OVHcloud Managed Private Registry, Docker Hub, GitHub packages, ...
261
+
In this example, we use the OVHcloud shared registry, available to every AI Deploy user. But you can also use other registires such as OVHcloud Managed Private Registry, Docker Hub, GitHub packages, etc.
262
262
263
263
> [!warning]
264
-
> **Warning**
264
+
>
265
265
> The shared registry should only be used for testing purpose. Please consider attaching your own registry. More information about this can be found [here](/pages/public_cloud/ai_machine_learning/gi_07_manage_registry). The images pushed to this registry are for AI Tools workloads only, and will not be accessible for external uses.
266
+
>
266
267
267
268
You can find the address of your shared registry by launching this command:
268
269
269
-
```bash
270
+
```sh
270
271
ovhai registry list
271
272
```
272
273
273
274
Log in to the shared registry with your usual AI Platform user credentials:
Tag the compiled image and push it into your registry:
280
281
281
-
```bash
282
+
```sh
282
283
docker tag flux-image <registry_address>/flux-image:latest
283
284
docker push <registry_address>/flux-image:latest
284
285
```
@@ -293,7 +294,7 @@ Run the following command to deploy your application:
293
294
294
295
> **Schnell**
295
296
>>
296
-
>> ```console
297
+
>> ```sh
297
298
>> ovhai app run <registry_address>/flux-image:latest \
298
299
>> --name flux-schnell-app \
299
300
>> --gpu 1 \
@@ -310,7 +311,7 @@ Run the following command to deploy your application:
310
311
>>
311
312
>**Dev**
312
313
>>
313
-
>> ```console
314
+
>>```sh
314
315
>> ovhai app run <registry_address>/flux-image:latest \
315
316
>> --name flux-dev-app \
316
317
>> --gpu 1 \
@@ -326,7 +327,7 @@ Run the following command to deploy your application:
326
327
>>
327
328
>**Kontext Dev**
328
329
>>
329
-
>> ```console
330
+
>>```sh
330
331
>> ovhai app run <registry_address>/flux-image:latest \
331
332
>> --name flux-kontext-app \
332
333
>> --gpu 1 \
@@ -352,8 +353,9 @@ Run the following command to deploy your application:
352
353
- `--env`: Sets environment variables used by `entrypoint.sh` to configure the FLUX model files symlinks.
353
354
354
355
> [!warning]
355
-
> **Warning**
356
+
>
356
357
> Other FLUX variants may expect files in different folders. If you plan to use another variant, make sure to also update the environment variables to match this variant, and adjust the `entrypoint.sh` script if necessary to match new files and folder structures.
358
+
>
357
359
358
360
Once you launch the app, AI Deploy will execute the following phases:
359
361
@@ -363,38 +365,38 @@ Once you launch the app, AI Deploy will execute the following phases:
363
365
364
366
To monitor your app progress and logs in real time, use:
365
367
366
-
```bash
368
+
```sh
367
369
ovhai app logs -f <app_id>
368
370
```
369
371
370
372
Once you see in the logs that ComfyUI has started and is listening on port `8188`, the app is ready to use. You can access the interface using the public URL provided by the platform, such as:
371
373
372
-
```
374
+
```console
373
375
https://<app_id>.app.gra.ai.cloud.ovh.net
374
376
```
375
377
376
378
You can retrieve it at any time using the following commands:
377
379
378
-
```
380
+
```sh
379
381
ovhai app list
380
382
ovhai app get <app_id>
381
383
```
382
384
383
385
### Run inference with ComfyUI
384
386
385
-
Once inside the ComfyUI web interface, head to the official [ComfyUI FLUX examples](https://comfyanonymous.github.io/ComfyUI_examples/flux/) page. Find the image matching your deployed variant.
387
+
Once inside the ComfyUI web interface, head to the official [ComfyUI FLUX examples](https://comfyanonymous.github.io/ComfyUI_examples/flux/){.external} page. Find the image matching your deployed variant.
386
388
387
389
Then, drag and drop this image into your ComfyUI interface. This will automatically load the FLUX image workflow.
388
390
389
391
You can now customize the text prompt or parameters as desired. Then, just click the `Run`{.action} button to start the image generation or editing process.
390
392
391
393
Once the image is generated, you can view and download it directly from the ComfyUI output node.
392
394
393
-
>> {.thumbnail}
395
+
{.thumbnail}
394
396
395
397
## Go further
396
398
397
-
If you want to deploy a different interface such as [AUTOMATIC1111]((https://github.com/AUTOMATIC1111/stable-diffusion-webui)) with Stable Diffusion XL, we have a [step-by-step guide](/pages/public_cloud/ai_machine_learning/deploy_tuto_18_gradio_stable_diffusion_webui) to deploy this popular Web UI on AI Deploy.
399
+
If you want to deploy a different interface such as [AUTOMATIC1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui){.external} with Stable Diffusion XL, we have a [step-by-step guide](/pages/public_cloud/ai_machine_learning/deploy_tuto_18_gradio_stable_diffusion_webui) to deploy this popular Web UI on AI Deploy.
398
400
399
401
If you are interested in image generation concepts, you can learn how image generation networks work and train your own Generative Adversarial Network. Check out this AI Notebooks guide: [Create and train an image generation model](/pages/public_cloud/ai_machine_learning/notebook_tuto_14_image-generation-dcgan).
400
402
@@ -404,4 +406,4 @@ If you need training or technical assistance to implement our solutions, contact
404
406
405
407
Please send us your questions, feedback and suggestions to improve the service:
406
408
407
-
- On the OVHcloud [Discord server](https://discord.gg/ovhcloud)
409
+
- On the OVHcloud [Discord server](https://discord.gg/ovhcloud)
0 commit comments