A little file for doing LLM-assisted prompt expansion and image generation using Flux.schnell - complete with prompt history, prompt queueing, LLM prompt expansion and aspect ratio picker - all on the command line, all in MLX :)
- Install Miniconda for macOS
- Run this in terminal:
conda create -n diffusionkit python=3.11 -y conda activate diffusionkit pip install diffusionkit
- Download flux.schnell and test it's working using this in terminal:
diffusionkit-cli --prompt "A robot holding a sign that says 'FLUX RULES!'" --output-path image.png --model-version FLUX.1-schnell --steps 4
- Download the PromptExpander.py file
- Run this in terminal:
Pip3 install fire mlx_lm prompt_toolkit
- Then run this to start up the PromptExpander CLI tool:
python PromptExpander.py
- Go through first time set up as it downloads Gemma-9b-SPPO
- Type in your prompts, instructions are given to you on the command-line
- Enjoy!
- (Optional): Go into PromptExpander.py and edit the full_prompt to your heart's content; tinkering with the single shot example provided by the model, as well as the system card, will affect the style of future images