FOCUS.AI

EST. 24

Image Generation Case Studies

I wanted to see how to run Flux locally on my MacBook and to try to understand some of the different things that would affect image quality.

I ended up building a Python script that would help automate that task and let you run a whole bunch of different variations. You can find it over here at mflux-commander, but let's look at some of the results.

Two models

Influx clones with the Schnell and Dev models both available. Dev models take a lot more steps, but I think make a little bit more interesting results. And the Schnell models are much faster and pretty much good enough. So I ended up using the Schnell models the most.

Steps on dev model

Let's run the same prompt a whole bunch of times, each with a varying number of steps. Here's an animation of what that looks like.

mflux-wrapper.py --model dev --seed 123 \
    --vary-steps 1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 \
    --square-sm \
    --prompt "A hand drawn color sketch in the style of a 1930s \
    newspaper of an old style airplane controls" 
    

So diffusion models sort of work by removing noise at each step and what's interesting is that what that translates into visually is almost a distinct picture. If we could look at the way that the airplane is drawn, they're not exact variations. They're much more complicated.

Dreamy Landscape

Let's change the prompt to Dreamy Landscape and see what it spits out.

mflux-wrapper.py --model dev --seed 123 \
    --vary-steps 1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 \
    --square-sm \
    --prompt "dreamy landscape"
    

Schnell model

We can run it with the same number of iterations at the dev model, but it doesn't change nearly as much.

mflux-wrapper.py --model schnell
    
Moving down to a fewer is all that's needed.
mflux-wrapper.py --prompt "magical forest" --vary-steps 1,2,3,4,5,6 --seed 123

Lil Robots

Here's an example of running the command with varying the number of steps that it takes to think about it.

Seeds

Let's run the same prompt a whole bunch of times, each with a random seed. These are effectively different variations of the same prompt and it's also cool to make like a whole bunch of them and then choose which one you kind of like the look of.

 mflux-wrapper.py --new \
        --prompt "The Little Prince with golden hair, dressed \
        in green and wrapped in a yellow scarf, tenderly caring \
        for a red rose on a small asteroid, \
        Van Gogh Starry Night sky, swirling stars, oil painting, \
        soft brush strokes, dreamy and whimsical." \
        --iterations 6
    
The Little Prince with golden hair, dressed         in green and wrapped in a yellow scarf, tenderly caring for a red rose on a         small asteroid, Van Gogh Starry Night sky, swirling stars, oil painting,         soft brush strokes, dreamy and whimsical.
The Little Prince with golden hair, dressed         in green and wrapped in a yellow scarf, tenderly caring for a red rose on a         small asteroid, Van Gogh Starry Night sky, swirling stars, oil painting,         soft brush strokes, dreamy and whimsical.
The Little Prince with golden hair, dressed         in green and wrapped in a yellow scarf, tenderly caring for a red rose on a         small asteroid, Van Gogh Starry Night sky, swirling stars, oil painting,         soft brush strokes, dreamy and whimsical.
The Little Prince with golden hair, dressed         in green and wrapped in a yellow scarf, tenderly caring for a red rose on a         small asteroid, Van Gogh Starry Night sky, swirling stars, oil painting,         soft brush strokes, dreamy and whimsical.
The Little Prince with golden hair, dressed         in green and wrapped in a yellow scarf, tenderly caring for a red rose on a         small asteroid, Van Gogh Starry Night sky, swirling stars, oil painting,         soft brush strokes, dreamy and whimsical.
The Little Prince with golden hair, dressed         in green and wrapped in a yellow scarf, tenderly caring for a red rose on a         small asteroid, Van Gogh Starry Night sky, swirling stars, oil painting,         soft brush strokes, dreamy and whimsical.

Step iteratons

You can then run it with a bunch more iterations and see which ones you want to end up going. I often find that like you only need three or four and if you get more steps in there it looks worse

mflux-wrapper.py --seed 188948 --vary-steps 2,3,4,5,6,7

Subscribe to our newsletter

Archived issues

What we offer

2024

01.
AI DIGITAL TRANSFORMATION USING BEST IN CLASS AI
02.
PRODUCT DESIGN AND ENGINEERING
03.
MODELING AND DATA INTERPRETATION FOR AI TUNING
04.
UPDATING OLD MOBILE AND WEB APPS FOR AI

CONTACT US TO GET STARTED.