File size: 2,347 Bytes
335e0cd
 
 
 
 
 
 
 
 
 
 
3c9d7a8
335e0cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f0dc184
 
 
 
 
 
 
 
 
 
 
 
e252092
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
license: other
license_name: flux-1-dev-non-commercial-license
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
language:
- en
library_name: diffusers
pipeline_tag: text-to-image
---
# FLUX.1 Merged Models - Several different Schnell:Dev ratios

This repository includes merged models from black-forest-labs/FLUX.1-dev and black-forest-labs/FLUX.1-schnell, in different ratios.  The licenses of both models apply to these merged models.

Inspired by: https://huggingface.co/sayakpaul/FLUX.1-merged

## Motivation

The goal is to create modeld which balance generation speed - allowing near-Dev generations in more like 4-16 generations.

## Results

<img src="./images/astronaut_grid_688x512.png">
<img src="./images/hacker_grid_688x512.png">
<img src="./images/astronaut_grid_880x656.png">
<img src="./images/sign_grid_880x656.png">
<img src="./images/astronaut_grid_880x656_saved_models.png">
<img src="./images/sign_grid_880x656_saved_models.png">

Based on these results, I saved and uploaded models for the ratios 10:1, 4:1, and 2.5:1.

I recommend The following number of generation steps for these models:
| Model | Steps |
|-------|-------|
| 10:1  | 4-8   |
| 4:1   | 8-16  |
| 2.5:1 | 8-16+ |

## Procedure

I modified sayakpaul's merge code to do merges at various ratios (weights), rather than simply averaging the two 1:1, and generated a series of images with those models, and the originals. See [merge_compare.py](./merege_compare.py).

I first did a series of ratios ranging from mostly Schnell to mostly Dev. Based on those results, I did more tests with larger images in ratios favoring Schnell more.

From these tests, I saved and uploaded a few of my favorite ratios, namely 10:1, 4:1, and 2.5:1. Then I did some additional generations* using those models, see [infer.py](./infer.py).

*1280x1024, Prompt1: "Impressionistic tableau medium shot painting with soft, blended brushstrokes and muted colors complemented by sporadic vibrant highlights.", Prompt2: 
10:1, 6 steps:
<img src="./images/flowers_10_1.png">

4:1, 10 steps:
<img src="./images/flowers_4_1.png">

2.51:1, 16 steps:
<img src="./images/flowers_2.5_1.png">

All image genereations where done with CFG=3.5. The test/grid images were done with seed=0, and the images of the two women with seed=42 (best of a batch of 4).