codehappy commited on
Commit
2be87a5
·
verified ·
1 Parent(s): 94b860e

update readme for epoch 18

Browse files
Files changed (1) hide show
  1. README.md +18 -7
README.md CHANGED
@@ -9,10 +9,10 @@ base_model:
9
  A latent diffusion model (LDM) geared toward illustration, style composability, and sample variety. Addresses a few deficiencies with the SDXL base model; feels more like an SD 1.x with better resolution and much better prompt adherence.
10
 
11
  * Architecture: SD XL (base model is v1.0)
12
- * Training procedure: U-Net fully unfrozen, all-parameter continued pretraining at LR between 3e-8 and 3e-7 for 18,000,000 steps (at epoch 17, batch size 4).
13
 
14
  Trained on the Puzzle Box dataset, a large collection of permissively licensed images from the public Internet (or generated by previous Puzzle Box models). Each image
15
- has from 3 to 17 different captions which are used interchangably during training. There are 9.3 million images and 62 million captions in the dataset.
16
 
17
  The model is substantially better than the base SDXL model at producing images that look like film photographs, any kind of cartoon art, or old artist styles. It's also
18
  heavily tuned toward personal aesthetic preference.
@@ -36,17 +36,25 @@ genre ("pop art", "advertising", "pixel art"), source ("wikiart", "library of co
36
  **Aesthetic labelling:** All images in the Puzzle Box dataset have been scored by multiple IQA models. There are also over 700,000 human paired image preferences. This data is combined to label especially high- or low-aesthetic images. Aesthetic breakpoints are chosen
37
  on a per-style/genre tag basis (the threshold for "pixel art" is different than "classical oil painting".)
38
 
39
- Training is broken into three phases: in the first phase, all images (regardless of aesthetic score) are used in training. In the second phase, bottom quartile-labelled
40
  images are removed from training. In the final phase, *only* images tagged as top quartile aesthetics are trained.
41
 
 
 
 
 
42
  **Other nifty tricks used:** Some less common techniques used in training Puzzle Box XL include:
43
 
 
 
 
 
44
  - *Attention masks*: constructed for images to exclude background or portions of the image not mentioned in captions/important to image content; we only update blocks that are not masked off.
45
- - *Lores-to-hires*: I save compute by training at lower resolution (512px) until the model learns new concepts satisfactorily, then training at higher resolution (768px).
46
- This allows later checkpoints to generate 1+ megapixel images without tiling or stuttering, while greatly speeding up earlier stages of training.
47
 
48
  Model checkpoints currently available:
49
 
 
50
  - from epoch 17, **18000k** training steps, 06 July 2025
51
  - from epoch 16, **16950k** training steps, 05 May 2025
52
  - from epoch 15, **15800k** training steps, 08 March 2025
@@ -54,15 +62,16 @@ Model checkpoints currently available:
54
  - from epoch 13, **11930k** training steps, 15 August 2024
55
  - from epoch 12, **10570k** training steps, 21 June 2024
56
 
57
- *Which checkpoint's best?* Later checkpoints have better aesthetics and better prompt adherence at higher resolution and lower CFG scale, but are also more 'opinionated'; longer conditioning may be necessary to get the generation as you like it. In particular, the latest checkpoints are trained on the most consensus captions, which are highly accurate but also quite long. Earlier checkpoints may give larger sample variety on short conditioning, which (at lower resolution) may make them useful drafting models: searching for good noise seeds, etc. Earlier checkpoints may also be better for merging with other LDMs based on SD XL.
58
 
59
  This model has been trained carefully on top of the SDXL base, with a widely diverse training set at low learning rate. Accordingly, it should *merge* well with most other
60
  LDMs built off SDXL base. (Merging LDMs built off the same base is a form of transfer learning; you can add Puzzle Box concepts to other SDXL models this way. Spherical
61
  interpolation is best.)
62
 
63
- The U-Net self-attention layers are the layers most modified by the continued pretrain; comparing those layers to SD XL 1.0, the correlation is:
64
  | Epoch | Date | R-squared |
65
  | ----- | ---------- | --------- |
 
66
  | 17 | 2025-07-06 | 97.705% |
67
  | 16 | 2025-05-05 | 97.917% |
68
  | 15 | 2025-03-08 | 98.312% |
@@ -70,4 +79,6 @@ The U-Net self-attention layers are the layers most modified by the continued pr
70
  | 13 | 2024-08-05 | 98.876% |
71
  | 12 | 2024-06-21 | 99.167% |
72
 
 
 
73
  (For reference, Pony-family models, which are also based on SD XL 1.0 but are trained at much higher LR, paving the model, are around 40%, and Playground-derived models, which are trained on SD XL architecture from static, are below 25%.)
 
9
  A latent diffusion model (LDM) geared toward illustration, style composability, and sample variety. Addresses a few deficiencies with the SDXL base model; feels more like an SD 1.x with better resolution and much better prompt adherence.
10
 
11
  * Architecture: SD XL (base model is v1.0)
12
+ * Training procedure: U-Net fully unfrozen, all-parameter continued pretraining at LR between 3e-8 and 3e-7 for 19,300,000 steps (at epoch 18, batch size 4). See below for more details.
13
 
14
  Trained on the Puzzle Box dataset, a large collection of permissively licensed images from the public Internet (or generated by previous Puzzle Box models). Each image
15
+ has from 3 to 24 different captions which are used interchangably during training. There are approximately 12 million images and 78 million captions in the dataset.
16
 
17
  The model is substantially better than the base SDXL model at producing images that look like film photographs, any kind of cartoon art, or old artist styles. It's also
18
  heavily tuned toward personal aesthetic preference.
 
36
  **Aesthetic labelling:** All images in the Puzzle Box dataset have been scored by multiple IQA models. There are also over 700,000 human paired image preferences. This data is combined to label especially high- or low-aesthetic images. Aesthetic breakpoints are chosen
37
  on a per-style/genre tag basis (the threshold for "pixel art" is different than "classical oil painting".)
38
 
39
+ **Staged training:** Each epoch is broken into phases. Up to epoch 15, there were three phases: in the first phase, all images (regardless of aesthetic score) are used in training. In the second phase, bottom quartile-labelled
40
  images are removed from training. In the final phase, *only* images tagged as top quartile aesthetics are trained.
41
 
42
+ In later epochs, a form of curriculum training is used: a complexity proxy is calculated for every image in the dataset, and the epoch begins with all (non-bottom quartile) images with below median complexity. The second phase is non-bottom quartile images of any complexity. Third and fourth (short) phases are done with solely consensus labels, with and without the maximum entropy restriction.
43
+
44
+ Epoch length was determined by the original size of the training set, and the best checkpoint that emerges after model soup experimentation is released.
45
+
46
  **Other nifty tricks used:** Some less common techniques used in training Puzzle Box XL include:
47
 
48
+ - *Data augumentation/conditional dropout*: taking inspiration from GAN-space, transformations are done (with some probability) on both the images and their labels in training. For example, an image might be converted to grayscale, rotated, or blurred. A booru-style caption will have its order of tags randomized, an English caption might have its sentences re-ordered. Labels may also be dropped out, wholly or partially. This helps the model generalize and avoid overfitting.
49
+ - *Mixed data*: my computer vision datasets contain extremely high quality captions (written by expert humans, or consensus captions drawn from a dozen+ human/machine captions) and quite low-quality captions (output by a super-fast but brain damaged bag of classifiers, etc.) They also take different forms: there are captions written in normal English, in other human languages, or booru-style captions that are just lists of tags applying to the image. *All* captions for a given image are candidates to be used as labels in supervised training. In any epoch, the high-quality captions are given a higher probability to be chosen as the label, but the short or bizarre captions are candidates as well. This permits the model to learn to respond to different prompting styles, rather than always expecting the verbose detailed consensus style.
50
+ - *Curriculum training*: compression ratio is used as a proxy for sample complexity. Samples with low complexity measure are trained early in the epoch, before samples with high complexity measure. This improves the speed of model convergence. It also identifies the noisiest/most troublesome and difficult-to-learn samples in the training set, which can be singled out for improved labels.
51
+ - *Synthetic data*: besides rendered images of text and raytracer output, the training set contains hundreds of thousands of Puzzle Box's own generations. This reinforces desired aesthetics and improves the quality of generations on the fringe of the model's capabilities.
52
  - *Attention masks*: constructed for images to exclude background or portions of the image not mentioned in captions/important to image content; we only update blocks that are not masked off.
53
+ - *Lores-to-hires*: I save compute by training at lower resolution (512px) until the model learns new concepts satisfactorily, then training at higher resolution (768px). This allows later checkpoints to generate 1+ megapixel images without tiling or stuttering, while greatly speeding up earlier stages of training.
 
54
 
55
  Model checkpoints currently available:
56
 
57
+ - from epoch 18, **19300k** training steps, 03 October 2025
58
  - from epoch 17, **18000k** training steps, 06 July 2025
59
  - from epoch 16, **16950k** training steps, 05 May 2025
60
  - from epoch 15, **15800k** training steps, 08 March 2025
 
62
  - from epoch 13, **11930k** training steps, 15 August 2024
63
  - from epoch 12, **10570k** training steps, 21 June 2024
64
 
65
+ *Which checkpoint's best?* You probably just want the latest checkpoint, unless you're interested in "model soup" merging approaches. Later checkpoints have better aesthetics and better prompt adherence at higher resolution and lower CFG scale, but are also more 'opinionated'; longer conditioning may be necessary to get the generation as you like it. In particular, the latest checkpoints are trained on the most consensus captions, which are highly accurate but also quite long. Earlier checkpoints may give larger sample variety on short conditioning, which (at lower resolution) may make them useful drafting models: searching for good noise seeds, etc. Earlier checkpoints may also be better for merging with other LDMs based on SD XL.
66
 
67
  This model has been trained carefully on top of the SDXL base, with a widely diverse training set at low learning rate. Accordingly, it should *merge* well with most other
68
  LDMs built off SDXL base. (Merging LDMs built off the same base is a form of transfer learning; you can add Puzzle Box concepts to other SDXL models this way. Spherical
69
  interpolation is best.)
70
 
71
+ The U-Net attention layers are the layers most modified by the continued pretrain; comparing those layers to SD XL 1.0, the correlation is:
72
  | Epoch | Date | R-squared |
73
  | ----- | ---------- | --------- |
74
+ | 18 | 2025-10-03 | 97.426% |
75
  | 17 | 2025-07-06 | 97.705% |
76
  | 16 | 2025-05-05 | 97.917% |
77
  | 15 | 2025-03-08 | 98.312% |
 
79
  | 13 | 2024-08-05 | 98.876% |
80
  | 12 | 2024-06-21 | 99.167% |
81
 
82
+ High correlation indicates minimal mode collapse/catastrophic forgetting of base model learnings; i.e. "what SDXL can do this model can still do". The generation quality and prompt adherence improvement are clear even cleaving close to the original model.
83
+
84
  (For reference, Pony-family models, which are also based on SD XL 1.0 but are trained at much higher LR, paving the model, are around 40%, and Playground-derived models, which are trained on SD XL architecture from static, are below 25%.)