Skip to content

Commit d9d42b9

Browse files
committed
finalize content
1 parent 3df40f4 commit d9d42b9

File tree

2 files changed

+57
-10
lines changed

2 files changed

+57
-10
lines changed

notebooks/flex.2-image-generation/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
# Image generation with universal control using Flex.2 and OpenVINO
22

3+
<div class="alert alert-block alert-danger"> <b>Important note:</b> This notebook requires python >= 3.11. Please make sure that your environment fulfill to this requirement before running it </div>
4+
35
Flex.2 is flexible text-to-image diffusion model based on Flux model architecture with built in support inpainting and universal control - model accepts pose, line, and depth inputs.
46

7+
<img src="https://github.com/user-attachments/assets/6a9ab66a-387a-4538-8625-2bb3a16072b5" width="1024">
8+
59
More details about model can be found in [model card](https://huggingface.co/ostris/Flex.2-preview).
610

711
In this tutorial we consider how to convert and optimize Flex.2 model using OpenVINO.
812

913
>**Note**: Some demonstrated models can require at least 32GB RAM for conversion and running.
1014
11-
<img src="https://raw.githubusercontent.com/black-forest-labs/flux/main/assets/grid.jpg" width="1024">
12-
1315
### Notebook Contents
1416

1517
In this demonstration, you will learn how to perform text-to-image generation using Flex.2 and OpenVINO.
1618

1719
Example of model work:
1820

19-
**Input prompt**: *a tiny Yorkshire terrier astronaut hatching from an egg on the moon*
20-
![](https://github.com/user-attachments/assets/11733314-0b31-449c-9885-12ebf6365a58)
21+
![](https://github.com/user-attachments/assets/140685b7-2c5d-4cef-86fb-33df0849ec1a)
2122

2223
The tutorial consists of the following steps:
2324

@@ -33,4 +34,5 @@ The tutorial consists of the following steps:
3334

3435
This is a self-contained example that relies solely on its own code.</br>
3536
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.
36-
For further details, please refer to [Installation Guide](../../README.md).
37+
For further details, please refer to [Installation Guide](../../README.md).
38+
<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=5b5a4db0-7875-4bfb-bdbd-01698b5b1a77&file=../notebooks/flex.2-image-generation/README.md" />

notebooks/flex.2-image-generation/flex.2-image-generation.ipynb

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,45 @@
77
"source": [
88
"# Image generation with universal control using Flex.2 and OpenVINO\n",
99
"\n",
10+
"<div class=\"alert alert-block alert-danger\"> <b>Important note:</b> This notebook requires python >= 3.10. Please make sure that your environment fulfill to this requirement before running it </div>\n",
11+
"\n",
1012
"Flex.2 is flexible text-to-image diffusion model based on Flux model architecture with built in support inpainting and universal control - model accepts pose, line, and depth inputs.\n",
1113
"\n",
14+
"![examples.png](https://github.com/user-attachments/assets/6a9ab66a-387a-4538-8625-2bb3a16072b5)\n",
15+
"\n",
1216
"More details about model can be found in [model card](https://huggingface.co/ostris/Flex.2-preview).\n",
1317
"\n",
1418
"In this tutorial we consider how to convert and optimize Flex.2 model using OpenVINO.\n",
1519
"\n",
16-
">**Note**: Some demonstrated models can require at least 32GB RAM for conversion and running."
20+
">**Note**: Some demonstrated models can require at least 32GB RAM for conversion and running.\n",
21+
"#### Table of contents:\n",
22+
"\n",
23+
"- [Prerequisites](#Prerequisites)\n",
24+
"- [Convert model with OpenVINO](#Convert-model-with-OpenVINO)\n",
25+
" - [Convert model using Optimum Intel](#Convert-model-using-Optimum-Intel)\n",
26+
" - [Compress model weights](#Compress-model-weights)\n",
27+
"- [Run OpenVINO model inference](#Run-OpenVINO-model-inference)\n",
28+
" - [Select inference device](#Select-inference-device)\n",
29+
"- [Interactive demo](#Interactive-demo)\n",
30+
"\n",
31+
"\n",
32+
"### Installation Instructions\n",
33+
"\n",
34+
"This is a self-contained example that relies solely on its own code.\n",
35+
"\n",
36+
"We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.\n",
37+
"For details, please refer to [Installation Guide](https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/README.md#-installation-guide).\n",
38+
"\n",
39+
"<img referrerpolicy=\"no-referrer-when-downgrade\" src=\"https://static.scarf.sh/a.png?x-pxid=5b5a4db0-7875-4bfb-bdbd-01698b5b1a77&file=../notebooks/flex.2-image-generation/flex.2-image-generation.ipynb\" />\n"
1740
]
1841
},
1942
{
2043
"attachments": {},
2144
"cell_type": "markdown",
2245
"metadata": {},
2346
"source": [
24-
"## Prerequisites"
47+
"## Prerequisites\n",
48+
"[back to top ⬆️](#Table-of-contents:)"
2549
]
2650
},
2751
{
@@ -106,7 +130,9 @@
106130
{
107131
"cell_type": "code",
108132
"execution_count": 3,
109-
"metadata": {},
133+
"metadata": {
134+
"test_replace": {"ostris/Flex.2-preview": "katuni4ka/tiny-random-flex.2-preview"}
135+
},
110136
"outputs": [
111137
{
112138
"data": {
@@ -148,7 +174,7 @@
148174
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
149175
"from notebook_utils import collect_telemetry\n",
150176
"\n",
151-
"collect_telemetry(\"flex2-image-generation.ipynb\")\n",
177+
"collect_telemetry(\"flex.2-image-generation.ipynb\")\n",
152178
"\n",
153179
"\n",
154180
"model_path = model_base_path / \"INT8\" if to_compress.value else model_base_path / \"FP16\"\n",
@@ -173,10 +199,12 @@
173199
"metadata": {},
174200
"source": [
175201
"## Run OpenVINO model inference\n",
202+
"[back to top ⬆️](#Table-of-contents:)\n",
176203
"\n",
177204
"Flex.2 is based on Flux.1 model, but for enabling image control and inpainting capability, model uses own customized pipeline. `ov_flex2_helper.py` contains `OVFlex2Pipeline` class, pipeline adoption for usage with OpenVINO. It is based on Optimum Intel inference API and preserves functional features from original pipeline.\n",
178205
"\n",
179206
"### Select inference device\n",
207+
"[back to top ⬆️](#Table-of-contents:)\n",
180208
"\n",
181209
"Select device from dropdown list for running inference using OpenVINO."
182210
]
@@ -344,7 +372,8 @@
344372
"cell_type": "markdown",
345373
"metadata": {},
346374
"source": [
347-
"## Interactive demo"
375+
"## Interactive demo\n",
376+
"[back to top ⬆️](#Table-of-contents:)"
348377
]
349378
},
350379
{
@@ -387,6 +416,22 @@
387416
"pygments_lexer": "ipython3",
388417
"version": "3.11.4"
389418
},
419+
"openvino_notebooks": {
420+
"imageUrl": "https://github.com/user-attachments/assets/6a9ab66a-387a-4538-8625-2bb3a16072b5",
421+
"tags": {
422+
"categories": [
423+
"Model Demos",
424+
"AI Trends"
425+
],
426+
"libraries": [],
427+
"other": [
428+
"Stable Diffusion"
429+
],
430+
"tasks": [
431+
"Image-to-Image"
432+
]
433+
}
434+
},
390435
"widgets": {
391436
"application/vnd.jupyter.widget-state+json": {
392437
"state": {

0 commit comments

Comments
 (0)