This can take a little while:
# Make sure you have git-lfs installed (https://git-lfs.com)
git lfs install
git clone https://huggingface.co/black-forest-labs/FLUX.1-schnell
git clone [email protected]:filipstrand/mflux.git
cd mflux && pip install -r requirements.txt
Name this anything, maybe flux.py
:
import sys
sys.path.append("/path/to/mflux/repo/src")
from flux_1_schnell.config.config import Config
from flux_1_schnell.models.flux import Flux1Schnell
flux = Flux1Schnell("path/to/model/FLUX.1-schnell/")
image = flux.generate_image(
seed=3,
prompt="A rocketship exactly in the style of the cartoon rocket emoji. The rocket ship is flying in the sky. The logo 'MLX' is written on the side of the ship in black letters.",
config=Config(num_inference_steps=2)
)
image.save("/path/to/save/image.png")
python flux.py