From c2b600dd9e9298c7e7910ded44cda7ed95a778bd Mon Sep 17 00:00:00 2001 From: Fabio Date: Sun, 18 Aug 2024 23:31:59 +0200 Subject: [PATCH] fix type and add main_dev --- main.py | 10 +++++----- main_dev.py | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 main_dev.py diff --git a/main.py b/main.py index 6d24b9b..00567f2 100644 --- a/main.py +++ b/main.py @@ -4,19 +4,19 @@ import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))) from flux_1_schnell.config.config import Config -from flux_1_schnell.flux import Flux1 +from flux_1_schnell.flux import Flux1Schnell +from flux_1_schnell.post_processing.image_util import ImageUtil -flux = Flux1("black-forest-labs/FLUX.1-dev", max_sequence_length=512) +flux = Flux1Schnell("black-forest-labs/FLUX.1-schnell") image = flux.generate_image( seed=3, prompt="Luxury food photograph of a birthday cake. In the middle it has three candles shaped like letters spelling the word 'MLX'. It has perfect lighting and a cozy background with big bokeh and shallow depth of field. The mood is a sunset balcony in tuscany. The photo is taken from the side of the cake. The scene is complemented by a warm, inviting light that highlights the textures and colors of the ingredients, giving it an appetizing and elegant look.", config=Config( - num_inference_steps=20, + num_inference_steps=2, height=768, width=1360, - guidance=3.5, ) ) -image.save("image.png") +ImageUtil.save_image(image, "image.png") \ No newline at end of file diff --git a/main_dev.py b/main_dev.py new file mode 100644 index 0000000..6d24b9b --- /dev/null +++ b/main_dev.py @@ -0,0 +1,22 @@ +import os +import sys + +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))) + +from flux_1_schnell.config.config import Config +from flux_1_schnell.flux import Flux1 + +flux = Flux1("black-forest-labs/FLUX.1-dev", max_sequence_length=512) + +image = flux.generate_image( + seed=3, + prompt="Luxury food photograph of a birthday cake. In the middle it has three candles shaped like letters spelling the word 'MLX'. It has perfect lighting and a cozy background with big bokeh and shallow depth of field. The mood is a sunset balcony in tuscany. The photo is taken from the side of the cake. The scene is complemented by a warm, inviting light that highlights the textures and colors of the ingredients, giving it an appetizing and elegant look.", + config=Config( + num_inference_steps=20, + height=768, + width=1360, + guidance=3.5, + ) +) + +image.save("image.png")