lodestones commited on
Commit
7f9bb7b
·
verified ·
1 Parent(s): 049fdc5

Model card: add 8-steps-dmd2-lora, refresh cats and PartiPrompts (Kromoss rows at update 11000)

Browse files
README.md CHANGED
@@ -17,12 +17,14 @@ Kromoss is a full fine-tune of [MOSS-Image-Base](https://huggingface.co/OpenMOSS
17
  decoder) as [MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT), and this repo has the same
18
  layout, so it is a drop-in replacement.
19
 
20
- The repo also ships `8-steps-dmd-lora.safetensors`, an 8-step turbo LoRA (data-space DMD distillation of
21
- MOSS-Image-Base): **8 steps, CFG 1**, no negative branch.
 
 
22
 
23
- | 50 steps, CFG 3 | 8 steps, CFG 1 + `8-steps-dmd-lora` |
24
- | --- | --- |
25
- | ![50 steps](assets/cat-50steps-cfg3.webp) | ![8 steps + LoRA](assets/cat-8steps-lora.webp) |
26
 
27
  Checkpoint: update 11000 of the fine-tune (EMA weights), 704k training images.
28
 
@@ -70,11 +72,12 @@ Native ComfyUI support for MOSS-Image is in current ComfyUI master. The single f
70
  | `diffusion_models/kromoss_int8_convrot.safetensors` | `models/diffusion_models/` | Load Diffusion Model (int8, 5.4 GB) |
71
  | `text_encoders/qwen3.5_9b_bf16.safetensors` | `models/text_encoders/` | Load CLIP, type `moss_image` |
72
  | `vae/flux2-vae_small.safetensors` | `models/vae/` | Load VAE |
 
73
  | `8-steps-dmd-lora.safetensors` | `models/loras/` | LoraLoaderModelOnly, strength 1 |
74
 
75
  `kromoss_bf16.safetensors` drops in for `moss_image_sft_bf16.safetensors` in the
76
- Comfy-Org workflows (50 steps, CFG 3). With the LoRA, use KSampler with `euler` / `simple`, 8 steps, CFG 1.
77
- ComfyUI maps the LoRA's separate q/k/v onto the fused `qkv` slices.
78
 
79
  `convert_to_comfy.py` converts any MOSS-Image diffusers `transformer/` folder (e.g. your own fine-tune) into this
80
  single-file format (needs only `torch` and `safetensors`):
@@ -90,19 +93,24 @@ On MOSS-Image-SFT's `transformer/` it reproduces Comfy-Org's `moss_image_sft_bf1
90
  The 168 block linears (`proj.{qkv,o,ffn_up_gate,ffn_down}`) are stored as int8 with per-row scales, after a
91
  256-wide regular Hadamard rotation of the input dimension. ComfyUI rebuilds the rotation at load time and applies it
92
  to the activations online, so no rotation matrices are stored. Each block also selects ComfyUI's int8 attention.
93
- It drops in for the int8 Comfy-Org file and works with the LoRA. `quantize_convrot.py` makes it from a bf16 single
94
  file; on `moss_image_sft_bf16.safetensors` it reproduces Comfy-Org's int8 file byte for byte:
95
 
96
  ```bash
97
  python quantize_convrot.py my_model_bf16.safetensors my_model_int8_convrot.safetensors
98
  ```
99
 
100
- ## 8-step turbo LoRA
 
 
 
 
 
101
 
102
- `8-steps-dmd-lora.safetensors`: fp32, rank 128 / alpha 128 on every block's `proj.{q,k,v,o,ffn_up_gate,ffn_down}`,
103
- kohya keys (`diffusion_model.<module>.lora_down.weight` / `lora_up.weight` / `alpha`). In ComfyUI, load it with
104
- a LoRA loader at strength 1. With diffusers, apply it unmerged. Do not merge it into the bf16 weights: the delta
105
- is close to bf16's rounding step.
106
 
107
  ```python
108
  from safetensors.torch import load_file
@@ -118,14 +126,14 @@ def apply_lora(transformer, path, strength=1.0):
118
  return out + (scale * (args[0].float() @ down.T) @ up.T).to(out.dtype)
119
  modules[name].register_forward_hook(hook)
120
 
121
- apply_lora(pipe.transformer, "8-steps-dmd-lora.safetensors") # hf_hub_download("lodestones/Kromoss", ...)
122
  image = pipe(prompt, height=1024, width=1024, num_inference_steps=8, guidance_scale=1.0,
123
  generator=torch.Generator("cpu").manual_seed(42)).images[0]
124
  ```
125
 
126
  ## Sampling settings
127
 
128
- | Setting | Full model | With `8-steps-dmd-lora` |
129
  | --- | --- | --- |
130
  | Sampler | Flow-matching Euler | Flow-matching Euler |
131
  | Steps | 50 | 8 |
@@ -133,14 +141,16 @@ image = pipe(prompt, height=1024, width=1024, num_inference_steps=8, guidance_sc
133
  | Shift | 5 | 5 |
134
  | Layer skipping | Negative branch, layer index 22 | none (no negative branch) |
135
 
136
- ## PartiPrompts (100 prompts, CLIP ViT-L/14 score; Kromoss rows measured at update 2000)
137
 
138
  | Model | CLIP |
139
  | --- | --- |
140
  | MOSS-Image-Base, 50 steps, CFG 3 | 27.19 |
141
- | MOSS-Image-Base + LoRA, 8 steps, CFG 1 | 27.53 |
142
- | Kromoss, 50 steps, CFG 3 | 26.88 |
143
- | Kromoss + LoRA, 8 steps, CFG 1 | **27.82** |
 
 
144
 
145
  Columns in the sheet below follow the table's order.
146
 
 
17
  decoder) as [MOSS-Image-SFT](https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT), and this repo has the same
18
  layout, so it is a drop-in replacement.
19
 
20
+ The repo also ships two 8-step turbo LoRAs distilled from MOSS-Image-Base: **8 steps, CFG 1**, no negative branch.
21
+ - `8-steps-dmd2-lora.safetensors` (recommended): the DMD LoRA below, further trained with DMD2's GAN stage against
22
+ real images. Slightly more contrast and detail, and the best PartiPrompts score.
23
+ - `8-steps-dmd-lora.safetensors`: data-space DMD distillation.
24
 
25
+ | 50 steps, CFG 3 | 8 steps, CFG 1 + `8-steps-dmd-lora` | 8 steps, CFG 1 + `8-steps-dmd2-lora` |
26
+ | --- | --- | --- |
27
+ | ![50 steps](assets/cat-50steps-cfg3.webp) | ![8 steps + DMD LoRA](assets/cat-8steps-lora.webp) | ![8 steps + DMD2 LoRA](assets/cat-8steps-lora-dmd2.webp) |
28
 
29
  Checkpoint: update 11000 of the fine-tune (EMA weights), 704k training images.
30
 
 
72
  | `diffusion_models/kromoss_int8_convrot.safetensors` | `models/diffusion_models/` | Load Diffusion Model (int8, 5.4 GB) |
73
  | `text_encoders/qwen3.5_9b_bf16.safetensors` | `models/text_encoders/` | Load CLIP, type `moss_image` |
74
  | `vae/flux2-vae_small.safetensors` | `models/vae/` | Load VAE |
75
+ | `8-steps-dmd2-lora.safetensors` | `models/loras/` | LoraLoaderModelOnly, strength 1 |
76
  | `8-steps-dmd-lora.safetensors` | `models/loras/` | LoraLoaderModelOnly, strength 1 |
77
 
78
  `kromoss_bf16.safetensors` drops in for `moss_image_sft_bf16.safetensors` in the
79
+ Comfy-Org workflows (50 steps, CFG 3). With either LoRA, use KSampler with `euler` / `simple`, 8 steps, CFG 1.
80
+ ComfyUI maps the LoRAs' separate q/k/v onto the fused `qkv` slices.
81
 
82
  `convert_to_comfy.py` converts any MOSS-Image diffusers `transformer/` folder (e.g. your own fine-tune) into this
83
  single-file format (needs only `torch` and `safetensors`):
 
93
  The 168 block linears (`proj.{qkv,o,ffn_up_gate,ffn_down}`) are stored as int8 with per-row scales, after a
94
  256-wide regular Hadamard rotation of the input dimension. ComfyUI rebuilds the rotation at load time and applies it
95
  to the activations online, so no rotation matrices are stored. Each block also selects ComfyUI's int8 attention.
96
+ It drops in for the int8 Comfy-Org file and works with the LoRAs. `quantize_convrot.py` makes it from a bf16 single
97
  file; on `moss_image_sft_bf16.safetensors` it reproduces Comfy-Org's int8 file byte for byte:
98
 
99
  ```bash
100
  python quantize_convrot.py my_model_bf16.safetensors my_model_int8_convrot.safetensors
101
  ```
102
 
103
+ ## 8-step turbo LoRAs
104
+
105
+ Both were distilled from MOSS-Image-Base (50 steps, CFG 3) and transfer to Kromoss:
106
+ - `8-steps-dmd-lora.safetensors`: data-space DMD, 12000 updates.
107
+ - `8-steps-dmd2-lora.safetensors`: that run continued for 3000 updates with DMD2's second stage, a GAN
108
+ discriminator on the fake score trained against real images, at a quarter of the learning rate.
109
 
110
+ Both are fp32, rank 128 / alpha 128 on every block's `proj.{q,k,v,o,ffn_up_gate,ffn_down}`, with kohya keys
111
+ (`diffusion_model.<module>.lora_down.weight` / `lora_up.weight` / `alpha`). Use one at a time. In ComfyUI, load it
112
+ with a LoRA loader at strength 1. With diffusers, apply it unmerged. Do not merge it into the bf16 weights: the
113
+ delta is close to bf16's rounding step. 4 steps also works.
114
 
115
  ```python
116
  from safetensors.torch import load_file
 
126
  return out + (scale * (args[0].float() @ down.T) @ up.T).to(out.dtype)
127
  modules[name].register_forward_hook(hook)
128
 
129
+ apply_lora(pipe.transformer, "8-steps-dmd2-lora.safetensors") # hf_hub_download("lodestones/Kromoss", ...)
130
  image = pipe(prompt, height=1024, width=1024, num_inference_steps=8, guidance_scale=1.0,
131
  generator=torch.Generator("cpu").manual_seed(42)).images[0]
132
  ```
133
 
134
  ## Sampling settings
135
 
136
+ | Setting | Full model | With either LoRA |
137
  | --- | --- | --- |
138
  | Sampler | Flow-matching Euler | Flow-matching Euler |
139
  | Steps | 50 | 8 |
 
141
  | Shift | 5 | 5 |
142
  | Layer skipping | Negative branch, layer index 22 | none (no negative branch) |
143
 
144
+ ## PartiPrompts (100 prompts, CLIP ViT-L/14 score; Kromoss rows measured at update 11000)
145
 
146
  | Model | CLIP |
147
  | --- | --- |
148
  | MOSS-Image-Base, 50 steps, CFG 3 | 27.19 |
149
+ | MOSS-Image-Base + `8-steps-dmd-lora`, 8 steps, CFG 1 | 27.53 |
150
+ | MOSS-Image-Base + `8-steps-dmd2-lora`, 8 steps, CFG 1 | 27.59 |
151
+ | Kromoss, 50 steps, CFG 3 | 27.90 |
152
+ | Kromoss + `8-steps-dmd-lora`, 8 steps, CFG 1 | 27.99 |
153
+ | Kromoss + `8-steps-dmd2-lora`, 8 steps, CFG 1 | **28.13** |
154
 
155
  Columns in the sheet below follow the table's order.
156
 
assets/cat-50steps-cfg3.webp CHANGED

Git LFS Details

  • SHA256: 68fac0a6405528ffc445b28fe1b6a462ac277c767a35c80d11172d3cd2381e8a
  • Pointer size: 131 Bytes
  • Size of remote file: 179 kB

Git LFS Details

  • SHA256: ab29670e1b70c1b8dd1c04b78277a65c5043650a5b5b32df52c9d980918830e0
  • Pointer size: 131 Bytes
  • Size of remote file: 195 kB
assets/cat-8steps-lora-dmd2.webp ADDED

Git LFS Details

  • SHA256: 842893a4f88b52fb4166e903ad4c9f6e00fcfe48f92f4deb144ac8683d67bdd4
  • Pointer size: 130 Bytes
  • Size of remote file: 63.4 kB
assets/cat-8steps-lora.webp CHANGED

Git LFS Details

  • SHA256: 4b0e263d364dcb278c60e4b9d5a4515233a1282b6e789ab47eff978872bfbd87
  • Pointer size: 130 Bytes
  • Size of remote file: 51.8 kB
assets/parti-comparison.webp CHANGED

Git LFS Details

  • SHA256: 4f4442cebddc40fa0bd4fc87fbe54409c6a9c5f9a9f6c3bcb15ea9d81fe43090
  • Pointer size: 131 Bytes
  • Size of remote file: 745 kB

Git LFS Details

  • SHA256: 7e6a571025394e1195c4648ca5aa3db3ab3c13e972a95cd58ce7020eadaa832d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.01 MB