Skip to content

Commit

Permalink
Add blog post on integrating FLUX text-to-image models in Galaxy
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Nov 26, 2024
1 parent 13a81d9 commit 85c2895
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions content/news/2024-11-26-FLUX/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: "Text-to-Image Magic: FLUX Models Now in Galaxy!"
date: "2024-11-26"
tease: "Turn your text into stunning visuals with FLUX models, now integrated into Galaxy!"
hide_tease: false
authors: Arash Kadkhodaei
subsites: [global, eu, us, freiburg]
tags: [tool]
---

## Using Black Forest Labs' FLUX Models Inside Galaxy: A Guide to Text-to-Image Integration
[The Black Forest Labs (BFL)](https://blackforestlabs.ai/) FLUX series has made significant strides in the world of generative AI, providing robust text-to-image capabilities tailored for various use cases. At Freiburg University, we've integrated FLUX.1 [schnell] and FLUX.1 [dev] into the Galaxy platform, enabling researchers and developers to generate high-quality images directly within Galaxy's user-friendly environment.

In this blog post, we'll explore the FLUX.1 models, their unique attributes, and how to use them effectively inside Galaxy.

## Overview of FLUX Models

**FLUX.1 [schnell]**
* Purpose: Designed for speed.
* License: Openly available under the Apache 2.0 license.
* Use Case: Ideal for personal use and rapid prototyping.

**FLUX.1 [dev]**
* Purpose: Guidance-distilled model for non-commercial applications, offering near-professional quality.
* License: Open-weight model intended for non-commercial contexts.
* Use Case: Suited for research and non-commercial exploration.

Both models provide easy access and versatility, making them excellent choices for text-to-image projects. While FLUX.1 [schnell] focuses on performance, FLUX.1 [dev] bridges the gap between quality and efficiency.

## Why Use FLUX Models Inside Galaxy?

Galaxy's open platform supports workflows across life sciences, data analysis, and beyond. By integrating FLUX models, users can:

* Generate visualizations: Convert textual descriptions into detailed images.
* Streamline workflows: Incorporate generative AI into multi-step Galaxy pipelines.
* Leverage open weights: FLUX's availability under open licenses aligns with Galaxy's ethos of accessibility and reproducibility.

To ensure high performance and speed, we are using a CUDA-based container to run the FLUX models on GPUs. This setup allows for fast inference times when working with the models from Hugging Face. By leveraging Hugging Face’s pre-trained models, we can efficiently load the weights and run inference directly within the Galaxy environment. The CUDA-based container ensures that the heavy computations involved in text-to-image generation are handled smoothly, providing users with a seamless experience.

## Setting Up FLUX in Galaxy

The FLUX models are already available on [UseGalaxy.eu](https://usegalaxy.eu/root?tool_id=toolshed.g2.bx.psu.edu/repos/bgruening/black_forest_labs_flux/black_forest_labs_flux/2024+galaxy3). Simply log in to your Galaxy instance and search for the FLUX tool in the tool panel.

Select the desired model (FLUX.1 [schnell] or FLUX.1 [dev]) based on your requirements.
Choose between File or Text based input and select your txt file or enter your text prompt in the designated input field.
Click Run Tool and let Galaxy handle the rest!
Once the process is complete, you’ll find the generated image in your Galaxy history, ready to view, share, or use in your workflows.

For an example, I used the text prompt "A galaxy full of stars" to generate an image. Here's [the result](https://usegalaxy.eu/u/brilliantarash/h/flux):

Text Prompt: `A galaxy full of stars`

Generated Image:

![FLUX_on_text_prompt_(A_galaxy_full_of_stars)](./FLUX_on_text_prompt_(A_galaxy_full_of_stars).png)

You can try out your own prompts and see what unique images FLUX can generate!

0 comments on commit 85c2895

Please sign in to comment.