mflux-cv 0.18.25__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (744) hide show
  1. mflux_cv-0.18.25/LICENSE +21 -0
  2. mflux_cv-0.18.25/PKG-INFO +475 -0
  3. mflux_cv-0.18.25/README.md +401 -0
  4. mflux_cv-0.18.25/pyproject.toml +197 -0
  5. mflux_cv-0.18.25/src/mflux/__init__.py +6 -0
  6. mflux_cv-0.18.25/src/mflux/callbacks/__init__.py +0 -0
  7. mflux_cv-0.18.25/src/mflux/callbacks/callback.py +53 -0
  8. mflux_cv-0.18.25/src/mflux/callbacks/callback_manager.py +115 -0
  9. mflux_cv-0.18.25/src/mflux/callbacks/callback_registry.py +44 -0
  10. mflux_cv-0.18.25/src/mflux/callbacks/callbacks.py +79 -0
  11. mflux_cv-0.18.25/src/mflux/callbacks/generation_context.py +75 -0
  12. mflux_cv-0.18.25/src/mflux/callbacks/instances/__init__.py +0 -0
  13. mflux_cv-0.18.25/src/mflux/callbacks/instances/battery_saver.py +83 -0
  14. mflux_cv-0.18.25/src/mflux/callbacks/instances/canny_saver.py +29 -0
  15. mflux_cv-0.18.25/src/mflux/callbacks/instances/depth_saver.py +32 -0
  16. mflux_cv-0.18.25/src/mflux/callbacks/instances/memory_saver.py +112 -0
  17. mflux_cv-0.18.25/src/mflux/callbacks/instances/stepwise_handler.py +109 -0
  18. mflux_cv-0.18.25/src/mflux/cli/__init__.py +0 -0
  19. mflux_cv-0.18.25/src/mflux/cli/completions/README.md +144 -0
  20. mflux_cv-0.18.25/src/mflux/cli/completions/__init__.py +0 -0
  21. mflux_cv-0.18.25/src/mflux/cli/completions/generator.py +476 -0
  22. mflux_cv-0.18.25/src/mflux/cli/completions/install.py +197 -0
  23. mflux_cv-0.18.25/src/mflux/cli/defaults/__init__.py +0 -0
  24. mflux_cv-0.18.25/src/mflux/cli/defaults/defaults.py +75 -0
  25. mflux_cv-0.18.25/src/mflux/cli/parser/__init__.py +0 -0
  26. mflux_cv-0.18.25/src/mflux/cli/parser/parsers.py +591 -0
  27. mflux_cv-0.18.25/src/mflux/models/__init__.py +0 -0
  28. mflux_cv-0.18.25/src/mflux/models/boogu/__init__.py +4 -0
  29. mflux_cv-0.18.25/src/mflux/models/boogu/boogu_initializer.py +69 -0
  30. mflux_cv-0.18.25/src/mflux/models/boogu/cli/__init__.py +0 -0
  31. mflux_cv-0.18.25/src/mflux/models/boogu/cli/boogu_image_generate.py +58 -0
  32. mflux_cv-0.18.25/src/mflux/models/boogu/model/__init__.py +0 -0
  33. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_text_encoder.py +49 -0
  34. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_transformer/__init__.py +0 -0
  35. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_transformer/boogu_attention.py +195 -0
  36. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_transformer/boogu_blocks.py +172 -0
  37. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_transformer/boogu_embeddings.py +186 -0
  38. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_transformer/boogu_rope.py +165 -0
  39. mflux_cv-0.18.25/src/mflux/models/boogu/model/boogu_transformer/boogu_transformer.py +181 -0
  40. mflux_cv-0.18.25/src/mflux/models/boogu/variants/__init__.py +3 -0
  41. mflux_cv-0.18.25/src/mflux/models/boogu/variants/txt2img/__init__.py +3 -0
  42. mflux_cv-0.18.25/src/mflux/models/boogu/variants/txt2img/boogu_image.py +149 -0
  43. mflux_cv-0.18.25/src/mflux/models/boogu/weights/__init__.py +0 -0
  44. mflux_cv-0.18.25/src/mflux/models/boogu/weights/boogu_weight_definition.py +80 -0
  45. mflux_cv-0.18.25/src/mflux/models/boogu/weights/boogu_weight_mapping.py +185 -0
  46. mflux_cv-0.18.25/src/mflux/models/common/README.md +644 -0
  47. mflux_cv-0.18.25/src/mflux/models/common/__init__.py +0 -0
  48. mflux_cv-0.18.25/src/mflux/models/common/cli/__init__.py +0 -0
  49. mflux_cv-0.18.25/src/mflux/models/common/cli/info.py +34 -0
  50. mflux_cv-0.18.25/src/mflux/models/common/cli/lora_library.py +26 -0
  51. mflux_cv-0.18.25/src/mflux/models/common/cli/save.py +82 -0
  52. mflux_cv-0.18.25/src/mflux/models/common/cli/train.py +41 -0
  53. mflux_cv-0.18.25/src/mflux/models/common/config/__init__.py +4 -0
  54. mflux_cv-0.18.25/src/mflux/models/common/config/config.py +182 -0
  55. mflux_cv-0.18.25/src/mflux/models/common/config/model_config.py +768 -0
  56. mflux_cv-0.18.25/src/mflux/models/common/latent_creator/__init__.py +0 -0
  57. mflux_cv-0.18.25/src/mflux/models/common/latent_creator/latent_creator.py +85 -0
  58. mflux_cv-0.18.25/src/mflux/models/common/lora/__init__.py +0 -0
  59. mflux_cv-0.18.25/src/mflux/models/common/lora/layer/__init__.py +0 -0
  60. mflux_cv-0.18.25/src/mflux/models/common/lora/layer/fused_linear_lora_layer.py +57 -0
  61. mflux_cv-0.18.25/src/mflux/models/common/lora/layer/linear_lokr_layer.py +113 -0
  62. mflux_cv-0.18.25/src/mflux/models/common/lora/layer/linear_lora_layer.py +90 -0
  63. mflux_cv-0.18.25/src/mflux/models/common/lora/mapping/__init__.py +0 -0
  64. mflux_cv-0.18.25/src/mflux/models/common/lora/mapping/lokr_factors.py +55 -0
  65. mflux_cv-0.18.25/src/mflux/models/common/lora/mapping/lora_loader.py +478 -0
  66. mflux_cv-0.18.25/src/mflux/models/common/lora/mapping/lora_mapping.py +70 -0
  67. mflux_cv-0.18.25/src/mflux/models/common/lora/mapping/lora_saver.py +212 -0
  68. mflux_cv-0.18.25/src/mflux/models/common/lora/mapping/lora_transforms.py +97 -0
  69. mflux_cv-0.18.25/src/mflux/models/common/resolution/__init__.py +6 -0
  70. mflux_cv-0.18.25/src/mflux/models/common/resolution/actions.py +39 -0
  71. mflux_cv-0.18.25/src/mflux/models/common/resolution/config_resolution.py +134 -0
  72. mflux_cv-0.18.25/src/mflux/models/common/resolution/lora_resolution.py +316 -0
  73. mflux_cv-0.18.25/src/mflux/models/common/resolution/path_resolution.py +183 -0
  74. mflux_cv-0.18.25/src/mflux/models/common/resolution/quantization_resolution.py +52 -0
  75. mflux_cv-0.18.25/src/mflux/models/common/schedulers/__init__.py +76 -0
  76. mflux_cv-0.18.25/src/mflux/models/common/schedulers/base_scheduler.py +15 -0
  77. mflux_cv-0.18.25/src/mflux/models/common/schedulers/flow_match_euler_discrete_scheduler.py +152 -0
  78. mflux_cv-0.18.25/src/mflux/models/common/schedulers/linear_scheduler.py +67 -0
  79. mflux_cv-0.18.25/src/mflux/models/common/schedulers/schedule_sigmas.py +29 -0
  80. mflux_cv-0.18.25/src/mflux/models/common/schedulers/seedvr2_euler_scheduler.py +58 -0
  81. mflux_cv-0.18.25/src/mflux/models/common/tokenizer/__init__.py +17 -0
  82. mflux_cv-0.18.25/src/mflux/models/common/tokenizer/tokenizer.py +188 -0
  83. mflux_cv-0.18.25/src/mflux/models/common/tokenizer/tokenizer_loader.py +476 -0
  84. mflux_cv-0.18.25/src/mflux/models/common/tokenizer/tokenizer_output.py +11 -0
  85. mflux_cv-0.18.25/src/mflux/models/common/training/__init__.py +0 -0
  86. mflux_cv-0.18.25/src/mflux/models/common/training/_example/train.json +43 -0
  87. mflux_cv-0.18.25/src/mflux/models/common/training/_example/train_ernie_image.json +43 -0
  88. mflux_cv-0.18.25/src/mflux/models/common/training/_example/train_ernie_image_turbo.json +43 -0
  89. mflux_cv-0.18.25/src/mflux/models/common/training/adapters/__init__.py +3 -0
  90. mflux_cv-0.18.25/src/mflux/models/common/training/adapters/base.py +59 -0
  91. mflux_cv-0.18.25/src/mflux/models/common/training/dataset/__init__.py +5 -0
  92. mflux_cv-0.18.25/src/mflux/models/common/training/dataset/batch.py +36 -0
  93. mflux_cv-0.18.25/src/mflux/models/common/training/dataset/data_cache.py +123 -0
  94. mflux_cv-0.18.25/src/mflux/models/common/training/dataset/dataset.py +13 -0
  95. mflux_cv-0.18.25/src/mflux/models/common/training/dataset/disk_backed_data.py +49 -0
  96. mflux_cv-0.18.25/src/mflux/models/common/training/dataset/iterator.py +151 -0
  97. mflux_cv-0.18.25/src/mflux/models/common/training/lora/__init__.py +8 -0
  98. mflux_cv-0.18.25/src/mflux/models/common/training/lora/path_util.py +57 -0
  99. mflux_cv-0.18.25/src/mflux/models/common/training/lora/target_injector.py +77 -0
  100. mflux_cv-0.18.25/src/mflux/models/common/training/optimization/__init__.py +3 -0
  101. mflux_cv-0.18.25/src/mflux/models/common/training/optimization/optimizer.py +81 -0
  102. mflux_cv-0.18.25/src/mflux/models/common/training/runner.py +257 -0
  103. mflux_cv-0.18.25/src/mflux/models/common/training/state/__init__.py +3 -0
  104. mflux_cv-0.18.25/src/mflux/models/common/training/state/training_spec.py +775 -0
  105. mflux_cv-0.18.25/src/mflux/models/common/training/state/training_state.py +248 -0
  106. mflux_cv-0.18.25/src/mflux/models/common/training/state/zip_util.py +49 -0
  107. mflux_cv-0.18.25/src/mflux/models/common/training/statistics/__init__.py +3 -0
  108. mflux_cv-0.18.25/src/mflux/models/common/training/statistics/plotter.py +706 -0
  109. mflux_cv-0.18.25/src/mflux/models/common/training/statistics/statistics.py +46 -0
  110. mflux_cv-0.18.25/src/mflux/models/common/training/trainer.py +389 -0
  111. mflux_cv-0.18.25/src/mflux/models/common/training/utils.py +76 -0
  112. mflux_cv-0.18.25/src/mflux/models/common/vae/__init__.py +4 -0
  113. mflux_cv-0.18.25/src/mflux/models/common/vae/tiling_config.py +13 -0
  114. mflux_cv-0.18.25/src/mflux/models/common/vae/vae_tiler.py +216 -0
  115. mflux_cv-0.18.25/src/mflux/models/common/vae/vae_util.py +73 -0
  116. mflux_cv-0.18.25/src/mflux/models/common/weights/__init__.py +14 -0
  117. mflux_cv-0.18.25/src/mflux/models/common/weights/loading/__init__.py +0 -0
  118. mflux_cv-0.18.25/src/mflux/models/common/weights/loading/loaded_weights.py +45 -0
  119. mflux_cv-0.18.25/src/mflux/models/common/weights/loading/safetensors_reader.py +95 -0
  120. mflux_cv-0.18.25/src/mflux/models/common/weights/loading/weight_applier.py +167 -0
  121. mflux_cv-0.18.25/src/mflux/models/common/weights/loading/weight_definition.py +72 -0
  122. mflux_cv-0.18.25/src/mflux/models/common/weights/loading/weight_loader.py +385 -0
  123. mflux_cv-0.18.25/src/mflux/models/common/weights/mapping/__init__.py +10 -0
  124. mflux_cv-0.18.25/src/mflux/models/common/weights/mapping/weight_mapper.py +198 -0
  125. mflux_cv-0.18.25/src/mflux/models/common/weights/mapping/weight_mapping.py +19 -0
  126. mflux_cv-0.18.25/src/mflux/models/common/weights/mapping/weight_transforms.py +33 -0
  127. mflux_cv-0.18.25/src/mflux/models/common/weights/saving/__init__.py +0 -0
  128. mflux_cv-0.18.25/src/mflux/models/common/weights/saving/model_saver.py +101 -0
  129. mflux_cv-0.18.25/src/mflux/models/common_models/__init__.py +11 -0
  130. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/__init__.py +31 -0
  131. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_attention.py +178 -0
  132. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_decoder.py +192 -0
  133. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_decoder_layer.py +64 -0
  134. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_mlp.py +17 -0
  135. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_rms_norm.py +17 -0
  136. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_rope.py +56 -0
  137. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_util.py +165 -0
  138. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_attention.py +96 -0
  139. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_block.py +40 -0
  140. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_mlp.py +27 -0
  141. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_model.py +251 -0
  142. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_patch_embed.py +41 -0
  143. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_patch_merger.py +29 -0
  144. mflux_cv-0.18.25/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_rotary_embedding.py +15 -0
  145. mflux_cv-0.18.25/src/mflux/models/depth_pro/README.md +33 -0
  146. mflux_cv-0.18.25/src/mflux/models/depth_pro/__init__.py +0 -0
  147. mflux_cv-0.18.25/src/mflux/models/depth_pro/cli/__init__.py +0 -0
  148. mflux_cv-0.18.25/src/mflux/models/depth_pro/cli/save_depth.py +25 -0
  149. mflux_cv-0.18.25/src/mflux/models/depth_pro/depth_pro_initializer.py +21 -0
  150. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/__init__.py +0 -0
  151. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/decoder/__init__.py +0 -0
  152. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/decoder/feature_fusion_block_2d.py +26 -0
  153. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/decoder/multires_conv_decoder.py +51 -0
  154. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/decoder/residual_block.py +36 -0
  155. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/depth_pro.py +78 -0
  156. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/depth_pro_model.py +19 -0
  157. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/depth_pro_util.py +73 -0
  158. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/__init__.py +0 -0
  159. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/attention.py +35 -0
  160. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/dino_vision_transformer.py +41 -0
  161. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/layer_scale.py +15 -0
  162. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/mlp.py +15 -0
  163. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/patch_embed.py +13 -0
  164. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/dino_v2/transformer_block.py +22 -0
  165. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/encoder/__init__.py +0 -0
  166. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/encoder/depth_pro_encoder.py +111 -0
  167. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/encoder/upsample_block.py +51 -0
  168. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/head/__init__.py +0 -0
  169. mflux_cv-0.18.25/src/mflux/models/depth_pro/model/head/fov_head.py +25 -0
  170. mflux_cv-0.18.25/src/mflux/models/depth_pro/weights/__init__.py +0 -0
  171. mflux_cv-0.18.25/src/mflux/models/depth_pro/weights/depth_pro_weight_definition.py +34 -0
  172. mflux_cv-0.18.25/src/mflux/models/depth_pro/weights/depth_pro_weight_mapping.py +307 -0
  173. mflux_cv-0.18.25/src/mflux/models/ernie_image/README.md +133 -0
  174. mflux_cv-0.18.25/src/mflux/models/ernie_image/__init__.py +4 -0
  175. mflux_cv-0.18.25/src/mflux/models/ernie_image/cli/__init__.py +0 -0
  176. mflux_cv-0.18.25/src/mflux/models/ernie_image/cli/ernie_image_generate.py +73 -0
  177. mflux_cv-0.18.25/src/mflux/models/ernie_image/cli/ernie_image_turbo_generate.py +72 -0
  178. mflux_cv-0.18.25/src/mflux/models/ernie_image/ernie_image_initializer.py +86 -0
  179. mflux_cv-0.18.25/src/mflux/models/ernie_image/latent_creator/__init__.py +3 -0
  180. mflux_cv-0.18.25/src/mflux/models/ernie_image/latent_creator/ernie_latent_creator.py +37 -0
  181. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/__init__.py +0 -0
  182. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_text_encoder/__init__.py +0 -0
  183. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_text_encoder/prompt_encoder.py +47 -0
  184. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_text_encoder/text_encoder.py +223 -0
  185. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/__init__.py +0 -0
  186. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/attention.py +52 -0
  187. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/feed_forward.py +13 -0
  188. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/rope_embedder.py +32 -0
  189. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/timestep_embedder.py +24 -0
  190. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/transformer.py +165 -0
  191. mflux_cv-0.18.25/src/mflux/models/ernie_image/model/ernie_transformer/transformer_block.py +36 -0
  192. mflux_cv-0.18.25/src/mflux/models/ernie_image/training_adapter/__init__.py +0 -0
  193. mflux_cv-0.18.25/src/mflux/models/ernie_image/training_adapter/ernie_training_adapter.py +147 -0
  194. mflux_cv-0.18.25/src/mflux/models/ernie_image/variants/__init__.py +3 -0
  195. mflux_cv-0.18.25/src/mflux/models/ernie_image/variants/txt2img/__init__.py +3 -0
  196. mflux_cv-0.18.25/src/mflux/models/ernie_image/variants/txt2img/ernie_image.py +228 -0
  197. mflux_cv-0.18.25/src/mflux/models/ernie_image/weights/__init__.py +0 -0
  198. mflux_cv-0.18.25/src/mflux/models/ernie_image/weights/ernie_lora_mapping.py +275 -0
  199. mflux_cv-0.18.25/src/mflux/models/ernie_image/weights/ernie_weight_definition.py +63 -0
  200. mflux_cv-0.18.25/src/mflux/models/ernie_image/weights/ernie_weight_mapping.py +113 -0
  201. mflux_cv-0.18.25/src/mflux/models/fibo/README.md +535 -0
  202. mflux_cv-0.18.25/src/mflux/models/fibo/__init__.py +0 -0
  203. mflux_cv-0.18.25/src/mflux/models/fibo/cli/__init__.py +0 -0
  204. mflux_cv-0.18.25/src/mflux/models/fibo/cli/fibo_edit.py +146 -0
  205. mflux_cv-0.18.25/src/mflux/models/fibo/cli/fibo_generate.py +88 -0
  206. mflux_cv-0.18.25/src/mflux/models/fibo/fibo_initializer.py +67 -0
  207. mflux_cv-0.18.25/src/mflux/models/fibo/latent_creator/__init__.py +0 -0
  208. mflux_cv-0.18.25/src/mflux/models/fibo/latent_creator/fibo_latent_creator.py +29 -0
  209. mflux_cv-0.18.25/src/mflux/models/fibo/model/__init__.py +0 -0
  210. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/__init__.py +7 -0
  211. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/prompt_encoder.py +190 -0
  212. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_attention.py +130 -0
  213. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_encoder_layer.py +64 -0
  214. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_mlp.py +30 -0
  215. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_rms_norm.py +17 -0
  216. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_rope.py +31 -0
  217. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_text_encoder.py +105 -0
  218. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/__init__.py +3 -0
  219. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/bria_fibo_timesteps.py +38 -0
  220. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/feed_forward.py +28 -0
  221. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/fibo_ada_layer_norm_zero.py +31 -0
  222. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/fibo_embed_nd.py +50 -0
  223. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/fibo_gelu.py +14 -0
  224. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/fibo_joint_attention.py +115 -0
  225. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/fibo_single_attention.py +80 -0
  226. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/joint_transformer_block.py +76 -0
  227. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/single_transformer_block.py +55 -0
  228. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/text_projection.py +10 -0
  229. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/time_embed.py +17 -0
  230. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_transformer/transformer.py +246 -0
  231. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/__init__.py +0 -0
  232. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/__init__.py +15 -0
  233. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_attention_block.py +48 -0
  234. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_causal_conv_3d.py +42 -0
  235. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_mid_block.py +22 -0
  236. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_resample.py +64 -0
  237. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_residual_block.py +35 -0
  238. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_rms_norm.py +32 -0
  239. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/decoder/__init__.py +3 -0
  240. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_decoder_3d.py +58 -0
  241. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_dup_up_3d.py +53 -0
  242. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_residual_up_block.py +60 -0
  243. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_up_block.py +34 -0
  244. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/encoder/__init__.py +3 -0
  245. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/encoder/wan_2_2_avg_down_3d.py +75 -0
  246. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/encoder/wan_2_2_down_block.py +57 -0
  247. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/encoder/wan_2_2_encoder_3d.py +75 -0
  248. mflux_cv-0.18.25/src/mflux/models/fibo/model/fibo_vae/wan_2_2_vae.py +111 -0
  249. mflux_cv-0.18.25/src/mflux/models/fibo/variants/__init__.py +0 -0
  250. mflux_cv-0.18.25/src/mflux/models/fibo/variants/edit/__init__.py +3 -0
  251. mflux_cv-0.18.25/src/mflux/models/fibo/variants/edit/fibo_edit.py +159 -0
  252. mflux_cv-0.18.25/src/mflux/models/fibo/variants/edit/util.py +143 -0
  253. mflux_cv-0.18.25/src/mflux/models/fibo/variants/txt2img/__init__.py +0 -0
  254. mflux_cv-0.18.25/src/mflux/models/fibo/variants/txt2img/fibo.py +160 -0
  255. mflux_cv-0.18.25/src/mflux/models/fibo/variants/txt2img/util.py +24 -0
  256. mflux_cv-0.18.25/src/mflux/models/fibo/weights/__init__.py +4 -0
  257. mflux_cv-0.18.25/src/mflux/models/fibo/weights/fibo_weight_definition.py +78 -0
  258. mflux_cv-0.18.25/src/mflux/models/fibo/weights/fibo_weight_mapping.py +605 -0
  259. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/__init__.py +0 -0
  260. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/cli/__init__.py +0 -0
  261. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/cli/fibo_inspire.py +46 -0
  262. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/cli/fibo_refine.py +43 -0
  263. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/fibo_vlm_initializer.py +55 -0
  264. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/model/__init__.py +0 -0
  265. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/model/fibo_vlm.py +567 -0
  266. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/model/util.py +42 -0
  267. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/tokenizer/__init__.py +1 -0
  268. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/tokenizer/qwen2vl_image_processor.py +14 -0
  269. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/tokenizer/qwen2vl_processor.py +205 -0
  270. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/weights/__init__.py +0 -0
  271. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/weights/fibo_vlm_weight_definition.py +72 -0
  272. mflux_cv-0.18.25/src/mflux/models/fibo_vlm/weights/fibo_vlm_weight_mapping.py +218 -0
  273. mflux_cv-0.18.25/src/mflux/models/flux/README.md +674 -0
  274. mflux_cv-0.18.25/src/mflux/models/flux/__init__.py +0 -0
  275. mflux_cv-0.18.25/src/mflux/models/flux/cli/__init__.py +0 -0
  276. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_concept.py +68 -0
  277. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_concept_from_image.py +67 -0
  278. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate.py +77 -0
  279. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_controlnet.py +74 -0
  280. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_depth.py +65 -0
  281. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_fill.py +64 -0
  282. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_in_context_catvton.py +78 -0
  283. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_in_context_dev.py +83 -0
  284. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_in_context_edit.py +85 -0
  285. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_kontext.py +75 -0
  286. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_generate_redux.py +73 -0
  287. mflux_cv-0.18.25/src/mflux/models/flux/cli/flux_upscale.py +67 -0
  288. mflux_cv-0.18.25/src/mflux/models/flux/flux_initializer.py +243 -0
  289. mflux_cv-0.18.25/src/mflux/models/flux/latent_creator/__init__.py +0 -0
  290. mflux_cv-0.18.25/src/mflux/models/flux/latent_creator/flux_latent_creator.py +22 -0
  291. mflux_cv-0.18.25/src/mflux/models/flux/model/__init__.py +0 -0
  292. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/__init__.py +0 -0
  293. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/__init__.py +0 -0
  294. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_embeddings.py +17 -0
  295. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_encoder.py +14 -0
  296. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_encoder_layer.py +25 -0
  297. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_mlp.py +19 -0
  298. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_sdpa_attention.py +42 -0
  299. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_text_model.py +32 -0
  300. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/encoder_clip.py +16 -0
  301. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/prompt_encoder.py +32 -0
  302. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/__init__.py +0 -0
  303. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_attention.py +18 -0
  304. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_block.py +18 -0
  305. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_dense_relu_dense.py +27 -0
  306. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_encoder.py +20 -0
  307. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_feed_forward.py +17 -0
  308. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_layer_norm.py +18 -0
  309. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_self_attention.py +70 -0
  310. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/__init__.py +0 -0
  311. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/ada_layer_norm_continuous.py +20 -0
  312. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/ada_layer_norm_zero.py +21 -0
  313. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/ada_layer_norm_zero_single.py +18 -0
  314. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/common/__init__.py +0 -0
  315. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/common/attention_utils.py +99 -0
  316. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/embed_nd.py +31 -0
  317. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/feed_forward.py +16 -0
  318. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/guidance_embedder.py +15 -0
  319. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/joint_attention.py +84 -0
  320. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/joint_transformer_block.py +91 -0
  321. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/single_block_attention.py +44 -0
  322. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/single_transformer_block.py +58 -0
  323. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/text_embedder.py +15 -0
  324. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/time_text_embed.py +43 -0
  325. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/timestep_embedder.py +15 -0
  326. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_transformer/transformer.py +190 -0
  327. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/__init__.py +0 -0
  328. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/common/__init__.py +0 -0
  329. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/common/attention.py +40 -0
  330. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/common/resnet_block_2d.py +72 -0
  331. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/common/unet_mid_block.py +21 -0
  332. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/__init__.py +0 -0
  333. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/conv_in.py +18 -0
  334. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/conv_norm_out.py +21 -0
  335. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/conv_out.py +18 -0
  336. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/decoder.py +100 -0
  337. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/up_block_1_or_2.py +26 -0
  338. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/up_block_3.py +26 -0
  339. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/up_block_4.py +20 -0
  340. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/decoder/up_sampler.py +27 -0
  341. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/__init__.py +0 -0
  342. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/conv_in.py +18 -0
  343. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/conv_norm_out.py +19 -0
  344. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/conv_out.py +18 -0
  345. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/down_block_1.py +24 -0
  346. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/down_block_2.py +24 -0
  347. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/down_block_3.py +24 -0
  348. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/down_block_4.py +18 -0
  349. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/down_sampler.py +19 -0
  350. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/encoder/encoder.py +36 -0
  351. mflux_cv-0.18.25/src/mflux/models/flux/model/flux_vae/vae.py +32 -0
  352. mflux_cv-0.18.25/src/mflux/models/flux/model/redux_encoder/__init__.py +0 -0
  353. mflux_cv-0.18.25/src/mflux/models/flux/model/redux_encoder/redux_encoder.py +12 -0
  354. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/__init__.py +0 -0
  355. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_encoder.py +16 -0
  356. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_encoder_layer.py +29 -0
  357. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_mlp.py +15 -0
  358. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_multi_head_attention_pooling_head.py +22 -0
  359. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_sdpa_attention.py +38 -0
  360. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_vision_embeddings.py +35 -0
  361. mflux_cv-0.18.25/src/mflux/models/flux/model/siglip_vision_transformer/siglip_vision_transformer.py +24 -0
  362. mflux_cv-0.18.25/src/mflux/models/flux/training_adapter/__init__.py +0 -0
  363. mflux_cv-0.18.25/src/mflux/models/flux/training_adapter/flux1_training_adapter.py +171 -0
  364. mflux_cv-0.18.25/src/mflux/models/flux/variants/__init__.py +0 -0
  365. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/__init__.py +1 -0
  366. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/attention_data.py +66 -0
  367. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/concept_util.py +90 -0
  368. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/flux_concept.py +176 -0
  369. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/flux_concept_from_image.py +195 -0
  370. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/joint_attention_concept.py +125 -0
  371. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/joint_transformer_block_concept.py +112 -0
  372. mflux_cv-0.18.25/src/mflux/models/flux/variants/concept_attention/transformer_concept.py +88 -0
  373. mflux_cv-0.18.25/src/mflux/models/flux/variants/controlnet/__init__.py +0 -0
  374. mflux_cv-0.18.25/src/mflux/models/flux/variants/controlnet/controlnet_util.py +52 -0
  375. mflux_cv-0.18.25/src/mflux/models/flux/variants/controlnet/flux_controlnet.py +275 -0
  376. mflux_cv-0.18.25/src/mflux/models/flux/variants/controlnet/transformer_controlnet.py +141 -0
  377. mflux_cv-0.18.25/src/mflux/models/flux/variants/depth/__init__.py +0 -0
  378. mflux_cv-0.18.25/src/mflux/models/flux/variants/depth/depth_util.py +67 -0
  379. mflux_cv-0.18.25/src/mflux/models/flux/variants/depth/flux_depth.py +155 -0
  380. mflux_cv-0.18.25/src/mflux/models/flux/variants/fill/__init__.py +0 -0
  381. mflux_cv-0.18.25/src/mflux/models/flux/variants/fill/flux_fill.py +154 -0
  382. mflux_cv-0.18.25/src/mflux/models/flux/variants/fill/mask_util.py +58 -0
  383. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/__init__.py +0 -0
  384. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/flux_in_context_dev.py +197 -0
  385. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/flux_in_context_fill.py +160 -0
  386. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/utils/__init__.py +0 -0
  387. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/utils/in_context_fill_util.py +28 -0
  388. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/utils/in_context_loras.py +32 -0
  389. mflux_cv-0.18.25/src/mflux/models/flux/variants/in_context/utils/in_context_mask_util.py +88 -0
  390. mflux_cv-0.18.25/src/mflux/models/flux/variants/kontext/__init__.py +0 -0
  391. mflux_cv-0.18.25/src/mflux/models/flux/variants/kontext/flux_kontext.py +154 -0
  392. mflux_cv-0.18.25/src/mflux/models/flux/variants/kontext/kontext_util.py +87 -0
  393. mflux_cv-0.18.25/src/mflux/models/flux/variants/redux/__init__.py +0 -0
  394. mflux_cv-0.18.25/src/mflux/models/flux/variants/redux/flux_redux.py +187 -0
  395. mflux_cv-0.18.25/src/mflux/models/flux/variants/redux/redux_util.py +70 -0
  396. mflux_cv-0.18.25/src/mflux/models/flux/variants/txt2img/__init__.py +0 -0
  397. mflux_cv-0.18.25/src/mflux/models/flux/variants/txt2img/flux.py +170 -0
  398. mflux_cv-0.18.25/src/mflux/models/flux/weights/__init__.py +4 -0
  399. mflux_cv-0.18.25/src/mflux/models/flux/weights/flux_lora_mapping.py +683 -0
  400. mflux_cv-0.18.25/src/mflux/models/flux/weights/flux_weight_definition.py +163 -0
  401. mflux_cv-0.18.25/src/mflux/models/flux/weights/flux_weight_mapping.py +817 -0
  402. mflux_cv-0.18.25/src/mflux/models/flux2/README.md +170 -0
  403. mflux_cv-0.18.25/src/mflux/models/flux2/__init__.py +4 -0
  404. mflux_cv-0.18.25/src/mflux/models/flux2/cli/__init__.py +1 -0
  405. mflux_cv-0.18.25/src/mflux/models/flux2/cli/flux2_edit_generate.py +92 -0
  406. mflux_cv-0.18.25/src/mflux/models/flux2/cli/flux2_generate.py +84 -0
  407. mflux_cv-0.18.25/src/mflux/models/flux2/flux2_initializer.py +95 -0
  408. mflux_cv-0.18.25/src/mflux/models/flux2/latent_creator/__init__.py +3 -0
  409. mflux_cv-0.18.25/src/mflux/models/flux2/latent_creator/flux2_latent_creator.py +96 -0
  410. mflux_cv-0.18.25/src/mflux/models/flux2/model/__init__.py +5 -0
  411. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_text_encoder/__init__.py +4 -0
  412. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_text_encoder/prompt_encoder.py +63 -0
  413. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_text_encoder/qwen3_text_encoder.py +124 -0
  414. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_text_encoder/qwen3_text_rotary_embedding.py +29 -0
  415. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/__init__.py +3 -0
  416. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/attention.py +98 -0
  417. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/feed_forward.py +27 -0
  418. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/flux2_kv_cache.py +118 -0
  419. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/modulation.py +17 -0
  420. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/parallel_self_attention.py +70 -0
  421. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/pos_embed.py +31 -0
  422. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/single_transformer_block.py +37 -0
  423. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/timestep_guidance_embeddings.py +39 -0
  424. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/transformer.py +183 -0
  425. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_transformer/transformer_block.py +62 -0
  426. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/__init__.py +3 -0
  427. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/__init__.py +15 -0
  428. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/attention.py +36 -0
  429. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/batch_norm_stats.py +11 -0
  430. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/downsample_2d.py +14 -0
  431. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/resnet_block_2d.py +33 -0
  432. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/unet_mid_block.py +22 -0
  433. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/common/upsample_2d.py +16 -0
  434. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/decoder/__init__.py +3 -0
  435. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/decoder/conv_in.py +12 -0
  436. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/decoder/conv_norm_out.py +14 -0
  437. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/decoder/conv_out.py +12 -0
  438. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/decoder/decoder.py +60 -0
  439. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/decoder/up_decoder_block.py +35 -0
  440. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/encoder/__init__.py +3 -0
  441. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/encoder/conv_in.py +12 -0
  442. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/encoder/conv_norm_out.py +14 -0
  443. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/encoder/conv_out.py +12 -0
  444. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/encoder/down_encoder_block.py +36 -0
  445. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/encoder/encoder.py +60 -0
  446. mflux_cv-0.18.25/src/mflux/models/flux2/model/flux2_vae/vae.py +66 -0
  447. mflux_cv-0.18.25/src/mflux/models/flux2/training_adapter/flux2_base_training_adapter.py +133 -0
  448. mflux_cv-0.18.25/src/mflux/models/flux2/training_adapter/flux2_edit_training_adapter.py +101 -0
  449. mflux_cv-0.18.25/src/mflux/models/flux2/training_adapter/flux2_training_adapter.py +68 -0
  450. mflux_cv-0.18.25/src/mflux/models/flux2/variants/__init__.py +4 -0
  451. mflux_cv-0.18.25/src/mflux/models/flux2/variants/edit/__init__.py +3 -0
  452. mflux_cv-0.18.25/src/mflux/models/flux2/variants/edit/flux2_klein_edit.py +341 -0
  453. mflux_cv-0.18.25/src/mflux/models/flux2/variants/edit/flux2_klein_edit_helpers.py +129 -0
  454. mflux_cv-0.18.25/src/mflux/models/flux2/variants/txt2img/__init__.py +3 -0
  455. mflux_cv-0.18.25/src/mflux/models/flux2/variants/txt2img/flux2_klein.py +287 -0
  456. mflux_cv-0.18.25/src/mflux/models/flux2/weights/__init__.py +5 -0
  457. mflux_cv-0.18.25/src/mflux/models/flux2/weights/flux2_lora_mapping.py +1588 -0
  458. mflux_cv-0.18.25/src/mflux/models/flux2/weights/flux2_weight_definition.py +64 -0
  459. mflux_cv-0.18.25/src/mflux/models/flux2/weights/flux2_weight_mapping.py +547 -0
  460. mflux_cv-0.18.25/src/mflux/models/ideogram4/README.md +310 -0
  461. mflux_cv-0.18.25/src/mflux/models/ideogram4/__init__.py +4 -0
  462. mflux_cv-0.18.25/src/mflux/models/ideogram4/cli/__init__.py +1 -0
  463. mflux_cv-0.18.25/src/mflux/models/ideogram4/cli/ideogram4_generate.py +87 -0
  464. mflux_cv-0.18.25/src/mflux/models/ideogram4/ideogram4_initializer.py +248 -0
  465. mflux_cv-0.18.25/src/mflux/models/ideogram4/latent_creator/__init__.py +3 -0
  466. mflux_cv-0.18.25/src/mflux/models/ideogram4/latent_creator/ideogram4_latent_creator.py +310 -0
  467. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/__init__.py +4 -0
  468. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_scheduler/__init__.py +7 -0
  469. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_scheduler/scheduler.py +111 -0
  470. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/__init__.py +17 -0
  471. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/attention.py +101 -0
  472. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/caption.py +327 -0
  473. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/decoder_layer.py +55 -0
  474. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/feed_forward.py +17 -0
  475. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/prompt_encoder.py +123 -0
  476. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/text_encoder.py +113 -0
  477. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_text_encoder/tokenizer.py +44 -0
  478. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/__init__.py +5 -0
  479. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/attention.py +54 -0
  480. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/config.py +15 -0
  481. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/feed_forward.py +15 -0
  482. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/fp8_linear.py +57 -0
  483. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/modulation.py +75 -0
  484. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/rope_embedder.py +60 -0
  485. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/transformer.py +106 -0
  486. mflux_cv-0.18.25/src/mflux/models/ideogram4/model/ideogram4_transformer/transformer_block.py +51 -0
  487. mflux_cv-0.18.25/src/mflux/models/ideogram4/training_adapter/__init__.py +0 -0
  488. mflux_cv-0.18.25/src/mflux/models/ideogram4/training_adapter/ideogram4_training_adapter.py +254 -0
  489. mflux_cv-0.18.25/src/mflux/models/ideogram4/variants/__init__.py +3 -0
  490. mflux_cv-0.18.25/src/mflux/models/ideogram4/variants/txt2img/__init__.py +3 -0
  491. mflux_cv-0.18.25/src/mflux/models/ideogram4/variants/txt2img/ideogram4.py +267 -0
  492. mflux_cv-0.18.25/src/mflux/models/ideogram4/weights/__init__.py +9 -0
  493. mflux_cv-0.18.25/src/mflux/models/ideogram4/weights/ideogram4_lora_mapping.py +176 -0
  494. mflux_cv-0.18.25/src/mflux/models/ideogram4/weights/ideogram4_weight_definition.py +157 -0
  495. mflux_cv-0.18.25/src/mflux/models/ideogram4/weights/ideogram4_weight_mapping.py +198 -0
  496. mflux_cv-0.18.25/src/mflux/models/krea2/README.md +147 -0
  497. mflux_cv-0.18.25/src/mflux/models/krea2/__init__.py +5 -0
  498. mflux_cv-0.18.25/src/mflux/models/krea2/cli/__init__.py +0 -0
  499. mflux_cv-0.18.25/src/mflux/models/krea2/cli/krea2_depth_generate.py +97 -0
  500. mflux_cv-0.18.25/src/mflux/models/krea2/cli/krea2_generate.py +84 -0
  501. mflux_cv-0.18.25/src/mflux/models/krea2/krea2_initializer.py +212 -0
  502. mflux_cv-0.18.25/src/mflux/models/krea2/latent_creator/__init__.py +3 -0
  503. mflux_cv-0.18.25/src/mflux/models/krea2/latent_creator/krea2_latent_creator.py +20 -0
  504. mflux_cv-0.18.25/src/mflux/models/krea2/model/__init__.py +0 -0
  505. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_sampler.py +78 -0
  506. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_scheduler/__init__.py +7 -0
  507. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_scheduler/krea2_flow_scheduler.py +17 -0
  508. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_text_encoder/__init__.py +0 -0
  509. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_text_encoder/prompt_encoder.py +42 -0
  510. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_text_encoder/text_encoder.py +127 -0
  511. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/__init__.py +0 -0
  512. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/attention.py +42 -0
  513. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/common.py +24 -0
  514. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/feed_forward.py +15 -0
  515. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/final_layer.py +18 -0
  516. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/modulation.py +23 -0
  517. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/rope_embedder.py +36 -0
  518. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/text_fusion.py +48 -0
  519. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/text_mlp.py +15 -0
  520. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/timestep_embedder.py +34 -0
  521. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/transformer.py +133 -0
  522. mflux_cv-0.18.25/src/mflux/models/krea2/model/krea2_transformer/transformer_block.py +23 -0
  523. mflux_cv-0.18.25/src/mflux/models/krea2/training_adapter/__init__.py +0 -0
  524. mflux_cv-0.18.25/src/mflux/models/krea2/training_adapter/krea2_training_adapter.py +178 -0
  525. mflux_cv-0.18.25/src/mflux/models/krea2/variants/__init__.py +3 -0
  526. mflux_cv-0.18.25/src/mflux/models/krea2/variants/controlnet/__init__.py +0 -0
  527. mflux_cv-0.18.25/src/mflux/models/krea2/variants/controlnet/krea2_depth.py +185 -0
  528. mflux_cv-0.18.25/src/mflux/models/krea2/variants/controlnet/krea2_depth_util.py +65 -0
  529. mflux_cv-0.18.25/src/mflux/models/krea2/variants/txt2img/__init__.py +3 -0
  530. mflux_cv-0.18.25/src/mflux/models/krea2/variants/txt2img/krea2.py +188 -0
  531. mflux_cv-0.18.25/src/mflux/models/krea2/weights/__init__.py +0 -0
  532. mflux_cv-0.18.25/src/mflux/models/krea2/weights/krea2_lora_mapping.py +150 -0
  533. mflux_cv-0.18.25/src/mflux/models/krea2/weights/krea2_weight_definition.py +135 -0
  534. mflux_cv-0.18.25/src/mflux/models/krea2/weights/krea2_weight_mapping.py +198 -0
  535. mflux_cv-0.18.25/src/mflux/models/qwen/README.md +256 -0
  536. mflux_cv-0.18.25/src/mflux/models/qwen/__init__.py +0 -0
  537. mflux_cv-0.18.25/src/mflux/models/qwen/cli/__init__.py +0 -0
  538. mflux_cv-0.18.25/src/mflux/models/qwen/cli/qwen_image_edit_generate.py +88 -0
  539. mflux_cv-0.18.25/src/mflux/models/qwen/cli/qwen_image_generate.py +72 -0
  540. mflux_cv-0.18.25/src/mflux/models/qwen/latent_creator/__init__.py +0 -0
  541. mflux_cv-0.18.25/src/mflux/models/qwen/latent_creator/qwen_latent_creator.py +17 -0
  542. mflux_cv-0.18.25/src/mflux/models/qwen/model/__init__.py +0 -0
  543. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/__init__.py +1 -0
  544. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_attention.py +138 -0
  545. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_encoder.py +113 -0
  546. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_encoder_layer.py +54 -0
  547. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_mlp.py +17 -0
  548. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_patch_merger.py +32 -0
  549. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_prompt_encoder.py +42 -0
  550. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_rms_norm.py +17 -0
  551. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_rope.py +36 -0
  552. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_text_encoder.py +72 -0
  553. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_attention.py +74 -0
  554. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_block.py +24 -0
  555. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_language_encoder.py +54 -0
  556. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_language_prompt_encoder.py +94 -0
  557. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_mlp.py +15 -0
  558. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_patch_embed.py +34 -0
  559. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_rotary_embedding.py +16 -0
  560. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_transformer.py +149 -0
  561. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/__init__.py +0 -0
  562. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_attention.py +158 -0
  563. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_feed_forward.py +15 -0
  564. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_layer_norm.py +18 -0
  565. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_rope.py +113 -0
  566. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_time_text_embed.py +17 -0
  567. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_timestep_embedding.py +15 -0
  568. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_timesteps.py +34 -0
  569. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_transformer.py +139 -0
  570. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_transformer_block.py +76 -0
  571. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_transformer/qwen_transformer_rms_norm.py +23 -0
  572. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/__init__.py +0 -0
  573. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_attention_block_3d.py +41 -0
  574. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_causal_conv_3d.py +41 -0
  575. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_decoder_3d.py +32 -0
  576. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_down_block_3d.py +26 -0
  577. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_encoder_3d.py +65 -0
  578. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_mid_block_3d.py +26 -0
  579. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_res_block_3d.py +30 -0
  580. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_resample_3d.py +50 -0
  581. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_rms_norm.py +33 -0
  582. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_image_up_block_3d.py +26 -0
  583. mflux_cv-0.18.25/src/mflux/models/qwen/model/qwen_vae/qwen_vae.py +69 -0
  584. mflux_cv-0.18.25/src/mflux/models/qwen/qwen_initializer.py +127 -0
  585. mflux_cv-0.18.25/src/mflux/models/qwen/tokenizer/__init__.py +2 -0
  586. mflux_cv-0.18.25/src/mflux/models/qwen/tokenizer/qwen_image_processor.py +162 -0
  587. mflux_cv-0.18.25/src/mflux/models/qwen/tokenizer/qwen_vision_language_processor.py +103 -0
  588. mflux_cv-0.18.25/src/mflux/models/qwen/tokenizer/qwen_vision_language_tokenizer.py +142 -0
  589. mflux_cv-0.18.25/src/mflux/models/qwen/variants/__init__.py +0 -0
  590. mflux_cv-0.18.25/src/mflux/models/qwen/variants/edit/__init__.py +4 -0
  591. mflux_cv-0.18.25/src/mflux/models/qwen/variants/edit/qwen_edit_util.py +96 -0
  592. mflux_cv-0.18.25/src/mflux/models/qwen/variants/edit/qwen_image_edit.py +270 -0
  593. mflux_cv-0.18.25/src/mflux/models/qwen/variants/edit/qwen_prompt_rewriter.py +116 -0
  594. mflux_cv-0.18.25/src/mflux/models/qwen/variants/txt2img/__init__.py +0 -0
  595. mflux_cv-0.18.25/src/mflux/models/qwen/variants/txt2img/qwen_image.py +176 -0
  596. mflux_cv-0.18.25/src/mflux/models/qwen/weights/__init__.py +4 -0
  597. mflux_cv-0.18.25/src/mflux/models/qwen/weights/qwen_lora_mapping.py +247 -0
  598. mflux_cv-0.18.25/src/mflux/models/qwen/weights/qwen_weight_definition.py +64 -0
  599. mflux_cv-0.18.25/src/mflux/models/qwen/weights/qwen_weight_mapping.py +858 -0
  600. mflux_cv-0.18.25/src/mflux/models/qwen_layered/__init__.py +1 -0
  601. mflux_cv-0.18.25/src/mflux/models/qwen_layered/cli/__init__.py +1 -0
  602. mflux_cv-0.18.25/src/mflux/models/qwen_layered/cli/qwen_image_layered_generate.py +161 -0
  603. mflux_cv-0.18.25/src/mflux/models/qwen_layered/cli/save_low_memory.py +101 -0
  604. mflux_cv-0.18.25/src/mflux/models/qwen_layered/latent_creator/__init__.py +1 -0
  605. mflux_cv-0.18.25/src/mflux/models/qwen_layered/latent_creator/qwen_layered_latent_creator.py +208 -0
  606. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/__init__.py +1 -0
  607. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_transformer/__init__.py +1 -0
  608. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_transformer/qwen_layered_rope.py +204 -0
  609. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_transformer/qwen_layered_transformer.py +165 -0
  610. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_vae/__init__.py +1 -0
  611. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_vae/qwen_layered_decoder_3d.py +39 -0
  612. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_vae/qwen_layered_encoder_3d.py +70 -0
  613. mflux_cv-0.18.25/src/mflux/models/qwen_layered/model/qwen_layered_vae/qwen_layered_vae.py +127 -0
  614. mflux_cv-0.18.25/src/mflux/models/qwen_layered/qwen_layered_initializer.py +82 -0
  615. mflux_cv-0.18.25/src/mflux/models/qwen_layered/variants/__init__.py +1 -0
  616. mflux_cv-0.18.25/src/mflux/models/qwen_layered/variants/i2l/__init__.py +1 -0
  617. mflux_cv-0.18.25/src/mflux/models/qwen_layered/variants/i2l/qwen_image_layered.py +358 -0
  618. mflux_cv-0.18.25/src/mflux/models/qwen_layered/weights/__init__.py +1 -0
  619. mflux_cv-0.18.25/src/mflux/models/qwen_layered/weights/qwen_layered_weight_definition.py +78 -0
  620. mflux_cv-0.18.25/src/mflux/models/qwen_layered/weights/qwen_layered_weight_mapping.py +57 -0
  621. mflux_cv-0.18.25/src/mflux/models/seedvr2/README.md +153 -0
  622. mflux_cv-0.18.25/src/mflux/models/seedvr2/__init__.py +6 -0
  623. mflux_cv-0.18.25/src/mflux/models/seedvr2/cli/__init__.py +0 -0
  624. mflux_cv-0.18.25/src/mflux/models/seedvr2/cli/seedvr2_upscale.py +119 -0
  625. mflux_cv-0.18.25/src/mflux/models/seedvr2/latent_creator/__init__.py +0 -0
  626. mflux_cv-0.18.25/src/mflux/models/seedvr2/latent_creator/seedvr2_latent_creator.py +28 -0
  627. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/__init__.py +0 -0
  628. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_text_encoder/__init__.py +0 -0
  629. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_text_encoder/embeddings/pos_emb.safetensors +0 -0
  630. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_text_encoder/text_embeddings.py +21 -0
  631. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/__init__.py +0 -0
  632. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/ada_modulation.py +68 -0
  633. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/attention.py +143 -0
  634. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/mm_swiglu.py +43 -0
  635. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/patch_in.py +33 -0
  636. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/patch_out.py +31 -0
  637. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/rms_norm.py +17 -0
  638. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/rope.py +205 -0
  639. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/swiglu_mlp.py +44 -0
  640. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/time_embedding.py +41 -0
  641. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/transformer.py +129 -0
  642. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/transformer_block.py +110 -0
  643. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_transformer/window.py +125 -0
  644. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/__init__.py +0 -0
  645. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/common/__init__.py +0 -0
  646. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/common/attention_3d.py +44 -0
  647. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/common/conv3d.py +55 -0
  648. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/__init__.py +0 -0
  649. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/decoder_3d.py +78 -0
  650. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/decoder_mid_block_3d.py +30 -0
  651. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/decoder_resnet_block_3d.py +42 -0
  652. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/up_block_3d.py +37 -0
  653. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/upsample_3d.py +48 -0
  654. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/__init__.py +0 -0
  655. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/down_block_3d.py +32 -0
  656. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/downsample_3d.py +25 -0
  657. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/encoder_3d.py +74 -0
  658. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/mid_block_3d.py +24 -0
  659. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/resnet_block_3d.py +43 -0
  660. mflux_cv-0.18.25/src/mflux/models/seedvr2/model/seedvr2_vae/vae.py +50 -0
  661. mflux_cv-0.18.25/src/mflux/models/seedvr2/seedvr2_initializer.py +55 -0
  662. mflux_cv-0.18.25/src/mflux/models/seedvr2/variants/__init__.py +0 -0
  663. mflux_cv-0.18.25/src/mflux/models/seedvr2/variants/upscale/__init__.py +0 -0
  664. mflux_cv-0.18.25/src/mflux/models/seedvr2/variants/upscale/seedvr2.py +114 -0
  665. mflux_cv-0.18.25/src/mflux/models/seedvr2/variants/upscale/seedvr2_util.py +235 -0
  666. mflux_cv-0.18.25/src/mflux/models/seedvr2/weights/__init__.py +0 -0
  667. mflux_cv-0.18.25/src/mflux/models/seedvr2/weights/seedvr2_weight_definition.py +117 -0
  668. mflux_cv-0.18.25/src/mflux/models/seedvr2/weights/seedvr2_weight_mapping.py +692 -0
  669. mflux_cv-0.18.25/src/mflux/models/z_image/README.md +130 -0
  670. mflux_cv-0.18.25/src/mflux/models/z_image/__init__.py +4 -0
  671. mflux_cv-0.18.25/src/mflux/models/z_image/cli/__init__.py +0 -0
  672. mflux_cv-0.18.25/src/mflux/models/z_image/cli/z_image_generate.py +82 -0
  673. mflux_cv-0.18.25/src/mflux/models/z_image/cli/z_image_turbo_generate.py +74 -0
  674. mflux_cv-0.18.25/src/mflux/models/z_image/latent_creator/__init__.py +3 -0
  675. mflux_cv-0.18.25/src/mflux/models/z_image/latent_creator/z_image_latent_creator.py +31 -0
  676. mflux_cv-0.18.25/src/mflux/models/z_image/model/__init__.py +2 -0
  677. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/__init__.py +2 -0
  678. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/attention.py +76 -0
  679. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/encoder_layer.py +35 -0
  680. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/mlp.py +13 -0
  681. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/prompt_encoder.py +17 -0
  682. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/rope.py +16 -0
  683. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_text_encoder/text_encoder.py +81 -0
  684. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/__init__.py +3 -0
  685. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/attention.py +90 -0
  686. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/context_block.py +23 -0
  687. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/feed_forward.py +13 -0
  688. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/final_layer.py +16 -0
  689. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/rope_embedder.py +37 -0
  690. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/timestep_embedder.py +37 -0
  691. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/transformer.py +201 -0
  692. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_transformer/transformer_block.py +35 -0
  693. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/__init__.py +3 -0
  694. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/common/__init__.py +5 -0
  695. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/common/attention.py +48 -0
  696. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/common/resnet_block_2d.py +70 -0
  697. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/common/unet_mid_block.py +21 -0
  698. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/__init__.py +3 -0
  699. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/conv_in.py +19 -0
  700. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/conv_norm_out.py +21 -0
  701. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/conv_out.py +19 -0
  702. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/decoder.py +36 -0
  703. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/up_decoder_block.py +47 -0
  704. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/decoder/up_sampler.py +27 -0
  705. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/__init__.py +3 -0
  706. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/conv_in.py +19 -0
  707. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/conv_norm_out.py +15 -0
  708. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/conv_out.py +19 -0
  709. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/down_encoder_block.py +41 -0
  710. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/down_sampler.py +20 -0
  711. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/encoder/encoder.py +35 -0
  712. mflux_cv-0.18.25/src/mflux/models/z_image/model/z_image_vae/vae.py +32 -0
  713. mflux_cv-0.18.25/src/mflux/models/z_image/training_adapter/z_image_training_adapter.py +149 -0
  714. mflux_cv-0.18.25/src/mflux/models/z_image/variants/__init__.py +5 -0
  715. mflux_cv-0.18.25/src/mflux/models/z_image/variants/z_image.py +233 -0
  716. mflux_cv-0.18.25/src/mflux/models/z_image/weights/__init__.py +4 -0
  717. mflux_cv-0.18.25/src/mflux/models/z_image/weights/z_image_lora_mapping.py +468 -0
  718. mflux_cv-0.18.25/src/mflux/models/z_image/weights/z_image_weight_definition.py +65 -0
  719. mflux_cv-0.18.25/src/mflux/models/z_image/weights/z_image_weight_mapping.py +615 -0
  720. mflux_cv-0.18.25/src/mflux/models/z_image/z_image_initializer.py +86 -0
  721. mflux_cv-0.18.25/src/mflux/release/__init__.py +0 -0
  722. mflux_cv-0.18.25/src/mflux/release/changelog_parser.py +116 -0
  723. mflux_cv-0.18.25/src/mflux/release/git_operations.py +59 -0
  724. mflux_cv-0.18.25/src/mflux/release/github_api.py +66 -0
  725. mflux_cv-0.18.25/src/mflux/release/pypi_publisher.py +165 -0
  726. mflux_cv-0.18.25/src/mflux/release/release_manager.py +92 -0
  727. mflux_cv-0.18.25/src/mflux/release/release_script.py +30 -0
  728. mflux_cv-0.18.25/src/mflux/release/release_validator.py +87 -0
  729. mflux_cv-0.18.25/src/mflux/utils/__init__.py +0 -0
  730. mflux_cv-0.18.25/src/mflux/utils/apple_silicon.py +33 -0
  731. mflux_cv-0.18.25/src/mflux/utils/box_values.py +65 -0
  732. mflux_cv-0.18.25/src/mflux/utils/dimension_resolver.py +65 -0
  733. mflux_cv-0.18.25/src/mflux/utils/exceptions.py +49 -0
  734. mflux_cv-0.18.25/src/mflux/utils/generated_image.py +269 -0
  735. mflux_cv-0.18.25/src/mflux/utils/image_compare.py +76 -0
  736. mflux_cv-0.18.25/src/mflux/utils/image_util.py +334 -0
  737. mflux_cv-0.18.25/src/mflux/utils/info_util.py +145 -0
  738. mflux_cv-0.18.25/src/mflux/utils/lora_library_util.py +100 -0
  739. mflux_cv-0.18.25/src/mflux/utils/metadata_builder.py +234 -0
  740. mflux_cv-0.18.25/src/mflux/utils/metadata_reader.py +94 -0
  741. mflux_cv-0.18.25/src/mflux/utils/prompt_util.py +55 -0
  742. mflux_cv-0.18.25/src/mflux/utils/saveinfo_util.py +41 -0
  743. mflux_cv-0.18.25/src/mflux/utils/scale_factor.py +44 -0
  744. mflux_cv-0.18.25/src/mflux/utils/version_util.py +32 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Filip Strand
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,475 @@
1
+ Metadata-Version: 2.3
2
+ Name: mflux-cv
3
+ Version: 0.18.25
4
+ Summary: MLX native implementations of state-of-the-art generative image models.
5
+ Keywords: flux,flux2,krea,krea-2,ideogram,ideogram-4,z-image,qwen,qwen-image,ernie,fibo,seedvr2,mlx,apple-silicon,metal,macos,mac,macbook,macbook-pro,on-device,local,m1,m2,m3,m4,m5,pro,max,image-generation,text-to-image,t2i,image-to-image,img2img,i2i,diffusion,stable-diffusion,generative-ai,inpainting,controlnet,lora,lokr,dora,fine-tuning,training,quantization,ai,ml,transformers,diffusers,huggingface
6
+ Author: Filip Strand
7
+ Author-email: Filip Strand <strand.filip@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Filip Strand
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Classifier: Intended Audience :: Developers
30
+ Classifier: Operating System :: MacOS
31
+ Classifier: Operating System :: POSIX :: Linux
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.10
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Classifier: Programming Language :: Python :: 3.14
38
+ Requires-Dist: filelock>=3.20.1
39
+ Requires-Dist: fonttools>=4.60.2
40
+ Requires-Dist: huggingface-hub>=1.1.6,<2.0
41
+ Requires-Dist: hf-transfer>=0.1.9,<1.0
42
+ Requires-Dist: matplotlib>=3.9.2,<4.0
43
+ Requires-Dist: mlx>=0.27.0,<0.32.0 ; sys_platform == 'darwin'
44
+ Requires-Dist: mlx[cuda13]>=0.30.3,<0.32.0 ; sys_platform == 'linux'
45
+ Requires-Dist: numpy>=2.0.1,<3.0
46
+ Requires-Dist: opencv-python>=4.10.0,<5.0
47
+ Requires-Dist: piexif>=1.1.3,<2.0
48
+ Requires-Dist: pillow>=12.1.1
49
+ Requires-Dist: platformdirs>=4.0,<5.0
50
+ Requires-Dist: regex>=2024.11.6
51
+ Requires-Dist: requests>=2.32.4
52
+ Requires-Dist: safetensors>=0.4.4,<1.0
53
+ Requires-Dist: sentencepiece>=0.2.1,<1.0
54
+ Requires-Dist: tokenizers>=0.20.3 ; python_full_version >= '3.13'
55
+ Requires-Dist: toml>=0.10.2,<1.0
56
+ Requires-Dist: torch>=2.7.1,<3.0
57
+ Requires-Dist: torch>=2.8.0,<3.0 ; python_full_version >= '3.13'
58
+ Requires-Dist: tqdm>=4.66.5,<5.0
59
+ Requires-Dist: transformers>=5.0.0,<6.0
60
+ Requires-Dist: twine>=6.1.0,<7.0
61
+ Requires-Dist: urllib3>=2.6.0
62
+ Requires-Dist: protobuf>=4.25.0,<8.0
63
+ Requires-Dist: matplotlib>3.10,<4.0 ; extra == 'dev'
64
+ Requires-Dist: pytest>=8.3.0,<9.0 ; extra == 'dev'
65
+ Requires-Dist: pytest-timer>=1.0,<2.0 ; extra == 'dev'
66
+ Requires-Dist: mlx==0.31.0 ; sys_platform == 'darwin' and extra == 'dev'
67
+ Requires-Dist: mlx[cuda13]==0.30.3 ; sys_platform == 'linux' and extra == 'dev'
68
+ Maintainer: Filip Strand
69
+ Maintainer-email: Filip Strand <strand.filip@gmail.com>
70
+ Requires-Python: >=3.10
71
+ Project-URL: homepage, https://github.com/filipstrand/mflux
72
+ Provides-Extra: dev
73
+ Description-Content-Type: text/markdown
74
+
75
+ # mflux-CV
76
+
77
+ A drop-in community build of [mflux](https://github.com/filipstrand/mflux) by Filip Strand (MIT). It
78
+ stays current with upstream `main` and adds a curated set of fixes, training features, and useful
79
+ community PRs, with prebuilt wheels on GitHub Releases so improvements are easy to pick up between
80
+ upstream releases. The Python package is still `mflux` and every CLI keeps its name,
81
+ so this is a direct replacement in ComfyUI, image-studio, or any existing setup.
82
+
83
+ **Install**
84
+
85
+ ```bash
86
+ pip install mflux-cv
87
+ ```
88
+
89
+ To track a specific tag instead, or to pick up work that has not been released yet:
90
+
91
+ ```bash
92
+ pip install git+https://github.com/HowDidTheCatGetSoFat/mflux-cv.git@v.0.18.25-CV
93
+ ```
94
+
95
+ Wheels are also attached to every [Release](https://github.com/HowDidTheCatGetSoFat/mflux-cv/releases).
96
+
97
+ > **Install this or upstream `mflux`, never both.** The distribution is named `mflux-cv` so it can
98
+ > live on PyPI alongside upstream, though both provide the same `mflux` import package. With both
99
+ > installed, pip raises no error while the two overwrite each other's files, and uninstalling either
100
+ > one leaves the other broken. Run `pip uninstall mflux` before installing this, and
101
+ > `pip uninstall mflux-cv` before going back.
102
+
103
+ **Relationship to upstream:** kept rebased on `filipstrand/mflux` so changes merge back cleanly. Every
104
+ upstream commit is included and nothing is removed. Credit for the base project and every pulled PR
105
+ goes to their authors.
106
+
107
+ ## Changelog (on top of upstream 0.18.0)
108
+
109
+ ### 0.18.25-CV
110
+
111
+ - **Multi-ControlNet for FLUX.1.** Several controlnets can now be stacked, each with its own
112
+ checkpoint, control image and strength (for example depth + canny). Repeat `--controlnet-path`
113
+ and `--controlnet-image-path` (and optionally `--controlnet-strength`, or give one value for all):
114
+
115
+ ```bash
116
+ mflux-generate-controlnet -m dev --prompt "a modern living room" \
117
+ --controlnet-path org/depth --controlnet-image-path depth.png --controlnet-strength 0.7 \
118
+ --controlnet-path org/canny --controlnet-image-path canny.png --controlnet-strength 0.4
119
+ ```
120
+
121
+ The residual path is additive, so each net's residuals are spread over the transformer's blocks
122
+ with the rule the transformer already applies and then summed. Controlnets with different block
123
+ counts stack correctly, and a single controlnet renders exactly as before (the expansion
124
+ reproduces the transformer's own selection index for index, which is pinned by a test).
125
+ - `--controlnet-path` is new: it selects a controlnet checkpoint (local path or HF repo) instead of
126
+ the one named by the model config, which also makes `Flux1Controlnet(controlnet_path=...)` work.
127
+ It was previously accepted by the constructor and silently ignored.
128
+ - A single `--controlnet-image-path` / `--controlnet-strength` keeps its scalar shape, so existing
129
+ commands and the metadata round-trip are unchanged.
130
+ - Canny preprocessing is decided per controlnet, from that net's own checkpoint name (the same match
131
+ `is_canny()` makes). A depth + canny stack therefore preprocesses only the canny image, and a
132
+ config-driven canny run behaves exactly as before.
133
+ - Known limitation: the image metadata holds a single controlnet, so a stacked run records only its
134
+ first net there. Metadata-driven re-runs of a stack are not supported; pass the flags explicitly.
135
+ Single-controlnet metadata is unchanged.
136
+
137
+ ### 0.18.24-CV
138
+
139
+ - FLUX.2-klein now exposes `flux2-klein-edit` / `flux2-edit` / `klein-edit` aliases (it does txt2img
140
+ and edit from the same weights), so the edit variant is selectable by name β€” used by the
141
+ ComfyUI-mflux-AnyModel node.
142
+ - Qwen-Image-Edit: skip the unconditional pass at guidance 1.0 (it reduces to the conditional noise
143
+ there), halving per-step compute for CFG-distilled setups like the Lightning step-reduction LoRAs.
144
+
145
+ ### 0.18.23-CV
146
+
147
+ - Updated the default Qwen models to the latest releases (based on #475's sibling, #474, credited
148
+ under [Community PRs pulled in](#community-prs-pulled-in)): `qwen-image` now loads Qwen-Image-2512 and
149
+ `qwen-image-edit` loads Qwen-Image-Edit-2511. The architecture is identical to the prior releases, so
150
+ they are drop-in; both were validated end-to-end on Apple Silicon. Unlike the upstream PR, the old
151
+ `qwen-edit-2509` alias still resolves to the actual 2509 weights (kept as its own entry) instead of
152
+ silently pointing at the new default.
153
+
154
+ ### 0.18.22-CV
155
+
156
+ - Pulled in configurable VAE decode tiling (#475, credited under [Community PRs pulled in](#community-prs-pulled-in)):
157
+ `--vae-tiling` / `--vae-tile-size` decouple tiled decoding from full low-RAM mode, so you can cut peak
158
+ memory on large generations without the rest of the low-RAM penalty.
159
+
160
+ ### 0.18.21-CV
161
+
162
+ - Krea 2 depth ControlNet: fix the estimated-depth convention (Depth Pro already outputs near = white,
163
+ like Depth-Anything-V2, so its map is now used un-inverted β€” an earlier inversion put the background in
164
+ front). `--save-depth-map` now writes the estimated map (`<output>_depth_map.png`).
165
+
166
+ ### 0.18.20-CV
167
+
168
+ - Krea 2 depth ControlNet now supports quantization (`-q 8` / `-q 4`): the control deltas are baked
169
+ into the base weights before quantization, so the packed model keeps the depth control. Validated
170
+ end-to-end at int8.
171
+
172
+ ### 0.18.19-CV
173
+ - New: **Krea 2 depth ControlNet** (`mflux-generate-krea2-controlnet`). Runs the community
174
+ [Krea-2-controlnet](https://github.com/Tanmaypatil123/Krea-2-controlnet) depth checkpoint natively in
175
+ MLX: the input projection is widened to take a depth latent concatenated on the channel axis, and the
176
+ attention/MLP deltas are merged into the base weights. Depth is taken from a supplied map
177
+ (`--depth-image-path`) or estimated with the native Depth Pro. See the Krea 2 depth ControlNet section
178
+ below.
179
+
180
+ ### 0.18.18-CV
181
+ - Pulled in two new upstream models (credited under [Community PRs pulled in](#community-prs-pulled-in)):
182
+ Boogu-Image-0.1-Turbo (#446, `mflux-generate-boogu`) and Qwen-Image-Layered (#302,
183
+ `mflux-generate-qwen-layered`) for decomposing an image into RGBA layers.
184
+
185
+ ### 0.18.17-CV
186
+ - Pulled in Ideogram 4 mlx-forge checkpoint loading (#445) and mixed-quant FLUX.2 inference (#436),
187
+ both credited under [Community PRs pulled in](#community-prs-pulled-in).
188
+
189
+ ### 0.18.16-CV
190
+ - Pulled in two upstream bug fixes (credited under [Community PRs pulled in](#community-prs-pulled-in)):
191
+ fused-qkv LoRA loading (#459) and ERNIE / Krea 2 tiled img2img (#463).
192
+ - Repo automation: CodeQL security scanning, structured issue forms, and PR / issue auto-labeling.
193
+
194
+ ### 0.18.15-CV
195
+ First release under the `mflux-CV` name, in the community home at
196
+ [HowDidTheCatGetSoFat/mflux-cv](https://github.com/HowDidTheCatGetSoFat/mflux-cv). Same codebase as the
197
+ prior `+fxd0h` builds (0.18.1 through 0.18.5); this is the rebrand plus everything listed below.
198
+
199
+ ### 0.18.5
200
+ - **Krea 2 `--krea2-uncensor <k>`**: scales the text-fusion projector's refusal layers (tapped Qwen3-VL
201
+ 9/10/11) so explicit prompts render instead of being dodged. `k=1` is off, `~6` neutralises the filter.
202
+
203
+ ### 0.18.4
204
+ - **LoRA on quantized bases**: keep the adapter live at inference instead of baking it into the quantized
205
+ weights (baking re-quantized and badly diverged the output on the `--quantize` default).
206
+ - **LoKr**: load LyCORIS LoKr adapters for Krea 2, Qwen, and Ideogram 4.
207
+ - **Ideogram 4**: fix the stepwise-preview VAE decode crash on already-unpacked latents; guard the
208
+ injected-LoRA scan against transformers without `named_modules`.
209
+ - **Krea 2 Raw**: download the diffusers transformer from HuggingFace.
210
+ - **z-image**: shared `--saveinfo` filename builder; fix numeric-tag collisions.
211
+ - **qwen-edit**: clearer error on empty `image_paths`; regenerated golden references.
212
+
213
+ ### 0.18.3
214
+ - Review fixes: fp8-aware fused DoRA, training guards (LR, grad-accum reset on skip, qwen VAE flag),
215
+ route the CFG negative through an injected LoRA in training previews, surface LoRA bake failures on
216
+ save, EMA resume from live weights.
217
+
218
+ ### 0.18.2
219
+ - **Krea 2 sigma schedule**: use the official dynamic exponential shift instead of a linear 1.15.
220
+
221
+ ### 0.18.1
222
+ - **Training suite**: DoRA (weight-decomposed LoRA) for Krea 2, Ideogram 4, z-image, flux, flux2;
223
+ gradient accumulation; EMA of trained weights; caption dropout; masked loss; regularization /
224
+ prior-preservation images; continue training from an existing LoRA; non-finite-step guard; utf-8-safe
225
+ captions; free training-loss plot.
226
+ - **Krea 2**: LoRA training, Raw variant, and diffusers-format loading.
227
+
228
+ ### Community PRs pulled in
229
+ - **[filipstrand/mflux#459](https://github.com/filipstrand/mflux/pull/459) by Sahil Tanveer** β€” fix LoRA
230
+ loading for fused qkv layers: keep the shared rank/down projection whole and slice only the up
231
+ projection, so kohya/BFL FLUX LoRAs with a rank divisible by 3/4 load correctly.
232
+ - **[filipstrand/mflux#463](https://github.com/filipstrand/mflux/pull/463) by Mike Wallio** β€” fix ERNIE
233
+ and Krea 2 img2img with tiled VAE latents: the 5D tiled-VAE pack path took the wrong slice; keep the
234
+ singleton temporal axis so tiled-decode img2img reconstructs correctly.
235
+ - **[filipstrand/mflux#445](https://github.com/filipstrand/mflux/pull/445) by plz12345** β€” load
236
+ Ideogram 4 from mlx-forge converted checkpoints (bf16 / int8) by HF repo id, skipping the fp8-only
237
+ validation; plus a once-built boolean attention keep-mask. Merged with our gradient-checkpointing.
238
+ - **[filipstrand/mflux#436](https://github.com/filipstrand/mflux/pull/436) by Ian Scrivener** β€” mixed-quant
239
+ inference for FLUX.2: quantize the transformer and text encoder to different levels, or load each from
240
+ its own path (`--model-transformer` / `--model-text-encoder`); the VAE stays bf16. Merged alongside our
241
+ LoKr flux2 changes.
242
+ - **[filipstrand/mflux#446](https://github.com/filipstrand/mflux/pull/446) by plz12345** β€” new model:
243
+ Boogu-Image-0.1-Turbo (`mflux-generate-boogu`). Applied cleanly.
244
+ - **[filipstrand/mflux#302](https://github.com/filipstrand/mflux/pull/302) by ZimengXiong** β€” new model:
245
+ Qwen-Image-Layered (`mflux-generate-qwen-layered`) for decomposing an image into RGBA layers, with a
246
+ low-memory chunked save path. We kept our README; the PR's stale old-structure README changes were dropped.
247
+ - **[filipstrand/mflux#475](https://github.com/filipstrand/mflux/pull/475) by azrahello** β€” configurable
248
+ VAE decode tiling: `--vae-tiling` and `--vae-tile-size` (min 128, multiple of 16) enable tiled decoding
249
+ on its own, decoupled from `--low-ram`, to lower peak memory during the VAE decode phase. Applied cleanly.
250
+ - **[filipstrand/mflux#474](https://github.com/filipstrand/mflux/pull/474) by imbible** β€” bump the default
251
+ Qwen models to Qwen-Image-2512 and Qwen-Image-Edit-2511. Both validated generating end-to-end on Apple
252
+ Silicon (identical architecture, drop-in). We diverged in one place: kept a separate `qwen-image-edit-2509`
253
+ entry so `qwen-edit-2509` still resolves to the real 2509 weights instead of the new default.
254
+
255
+ ### Krea 2 depth ControlNet
256
+
257
+ Steer a Krea 2 generation with the depth of a reference image, running natively in MLX. Uses the
258
+ community [Krea-2-controlnet](https://github.com/Tanmaypatil123/Krea-2-controlnet) depth checkpoint by
259
+ Tanmay Patil (base weights: `krea/Krea-2-Raw` / `krea/Krea-2-Turbo`).
260
+
261
+ ```bash
262
+ mflux-generate-krea2-controlnet \
263
+ --model krea2 \
264
+ --controlnet-path /path/to/depth-control-lora.safetensors \
265
+ --image-path reference.png \
266
+ --prompt "a glowing crystal orb on a wooden table, studio photo" \
267
+ --steps 8 --seed 42 --height 1024 --width 1024 \
268
+ --output out.png
269
+ ```
270
+
271
+ - `--image-path` estimates depth with the native Depth Pro (near = white, used as-is, the same
272
+ convention the checkpoint was trained on). Add `--save-depth-map` to also write the estimated map. For
273
+ the closest match to the training data, pass a Depth-Anything-V2 map directly with `--depth-image-path`.
274
+ - `--controlnet-strength` scales how strongly the control deltas are merged (default `1.0`).
275
+ - `--krea2-uncensor` is supported here too.
276
+ - `-q 8` / `-q 4` quantize the variant: the control deltas are baked into the base weights before
277
+ quantization, so the packed model keeps the depth control.
278
+
279
+ ---
280
+
281
+ > The rest of this file is the upstream mflux documentation.
282
+
283
+ ![image](src/mflux/assets/logo.jpg)
284
+
285
+ [![MFLUX](https://img.shields.io/pypi/v/mflux?label=MFLUX&logo=pypi&logoColor=white)](https://pypi.org/project/mflux/)
286
+ [![MLX](https://img.shields.io/pypi/v/mlx?label=MLX&logo=pypi&logoColor=white)](https://pypi.org/project/mlx/)
287
+ [![CI](https://github.com/filipstrand/mflux/actions/workflows/tests.yml/badge.svg)](https://github.com/filipstrand/mflux/actions/workflows/tests.yml)
288
+
289
+ ### About
290
+
291
+ Run the latest state-of-the-art generative image models locally on your Mac in native MLX!
292
+
293
+ ### Table of contents
294
+
295
+ - [πŸ’‘ Philosophy](#-philosophy)
296
+ - [πŸ’Ώ Installation](#-installation)
297
+ - [🎨 Models](#-models)
298
+ - [✨ Features](#-features)
299
+ - [🌱 Related projects](#related-projects)
300
+ - [πŸ™ Acknowledgements](#-acknowledgements)
301
+ - [βš–οΈ License](#%EF%B8%8F-license)
302
+
303
+ ---
304
+
305
+ ### πŸ’‘ Philosophy
306
+
307
+ MFLUX is a line-by-line MLX port of several state-of-the-art generative image models from the [Huggingface Diffusers](https://github.com/huggingface/diffusers) and [Huggingface Transformers](https://github.com/huggingface/transformers) libraries. All models are implemented from scratch in MLX, using only tokenizers from the [Huggingface Transformers](https://github.com/huggingface/transformers) library. MFLUX is purposefully kept minimal and explicit, [@karpathy](https://gist.github.com/awni/a67d16d50f0f492d94a10418e0592bde?permalink_comment_id=5153531#gistcomment-5153531) style.
308
+
309
+ ---
310
+
311
+ ### πŸ’Ώ Installation
312
+ If you haven't already, [install `uv`](https://github.com/astral-sh/uv?tab=readme-ov-file#installation), then run:
313
+
314
+ ```sh
315
+ uv tool install --upgrade mflux
316
+ ```
317
+
318
+ After installation, the following command shows all available MFLUX CLI commands:
319
+
320
+ ```sh
321
+ uv tool list
322
+ ```
323
+
324
+ To generate your first image using, for example, the z-image-turbo model, run
325
+
326
+ ```
327
+ mflux-generate-z-image-turbo \
328
+ --prompt "A puffin standing on a cliff" \
329
+ --width 1280 \
330
+ --height 500 \
331
+ --seed 42 \
332
+ --steps 9 \
333
+ -q 8
334
+ ```
335
+
336
+ ![Puffin](src/mflux/assets/puffin.png)
337
+
338
+ The first time you run this, the model will automatically download which can take some time. See the [model section](#-models) for the different options and features, and the [common README](src/mflux/models/common/README.md) for shared CLI patterns and examples.
339
+
340
+ <details>
341
+ <summary>Python API</summary>
342
+
343
+ Create a standalone `generate.py` script with inline `uv` dependencies:
344
+
345
+ ```python
346
+ #!/usr/bin/env -S uv run --script
347
+ # /// script
348
+ # requires-python = ">=3.10"
349
+ # dependencies = [
350
+ # "mflux",
351
+ # ]
352
+ # ///
353
+ from mflux.models.z_image import ZImageTurbo
354
+
355
+ model = ZImageTurbo(quantize=8)
356
+ image = model.generate_image(
357
+ prompt="A puffin standing on a cliff",
358
+ seed=42,
359
+ num_inference_steps=9,
360
+ width=1280,
361
+ height=500,
362
+ )
363
+ image.save("puffin.png")
364
+ ```
365
+
366
+ Run it with:
367
+
368
+ ```sh
369
+ uv run generate.py
370
+ ```
371
+
372
+ For more Python API inspiration, look at the [CLI entry points](src/mflux/models/z_image/cli/z_image_turbo_generate.py) for the respective models.
373
+ </details>
374
+
375
+ <details>
376
+ <summary>⚠️ Troubleshooting: hf_transfer error</summary>
377
+
378
+ If you encounter a `ValueError: Fast download using 'hf_transfer' is enabled (HF_HUB_ENABLE_HF_TRANSFER=1) but 'hf_transfer' package is not available`, you can install MFLUX with the `hf_transfer` package included:
379
+
380
+ ```sh
381
+ uv tool install --upgrade mflux --with hf_transfer
382
+ ```
383
+
384
+ This will enable faster model downloads from Hugging Face.
385
+
386
+ </details>
387
+
388
+ <details>
389
+ <summary>DGX / NVIDIA (uv tool install)</summary>
390
+
391
+ ```sh
392
+ uv tool install --python 3.13 mflux
393
+ ```
394
+ </details>
395
+
396
+ ---
397
+
398
+ ### 🎨 Models
399
+
400
+ MFLUX supports the following model families. They have different strengths and weaknesses; see each model’s README for full usage details.
401
+
402
+ | Model | Release date | Size | Type | Training | Description |
403
+ | --- | --- | --- | --- | --- | --- |
404
+ |[Z-Image](src/mflux/models/z_image/README.md) | Nov 2025 | 6B | Distilled & Base | Yes | Fast, small, very good quality and realism. |
405
+ |[Krea 2](src/mflux/models/krea2/README.md) | Jun 2026 | 12B | Turbo (distilled) | No | Very good quality with a wide range of styles; good for creative exploration. |
406
+ |[FLUX.2](src/mflux/models/flux2/README.md) | Jan 2026 | 4B & 9B | Distilled & Base | Yes | Fastest + smallest with very good qaility and edit capabilities. |
407
+ |[Ideogram 4](src/mflux/models/ideogram4/README.md) | Jun 2026 | 9B | Base | No | JSON-caption-native, typography-focused text-to-image generation. |
408
+ |[ERNIE-Image](src/mflux/models/ernie_image/README.md) | Apr 2026 | 8B | Distilled & Base | No | Single-stream DiT from Baidu. Vivid, high-contrast output. |
409
+ |[FIBO](src/mflux/models/fibo/README.md) | Oct 2025+ | 8B | Distilled & Base | No | Very good JSON-based prompt understanding. Has edit capabilities. |
410
+ |[SeedVR2](src/mflux/models/seedvr2/README.md) | Jun 2025 | 3B & 7B | β€” | No | Best upscaling model. |
411
+ |[Qwen Image](src/mflux/models/qwen/README.md) | Aug 2025+ | 20B | Base | No | Large model (slower); strong prompt understanding and world knowledge. Has edit capabilities |
412
+ |[Depth Pro](src/mflux/models/depth_pro/README.md) | Oct 2024 | β€” | β€” | No | Very fast and accurate depth estimation model from Apple. |
413
+ |[FLUX.1](src/mflux/models/flux/README.md) | Aug 2024 | 12B | Distilled & Base | No (legacy) | Legacy option with decent quality. Has edit capabilities with 'Kontext' model and upscaling support via ControlNet |
414
+
415
+ ---
416
+
417
+ ### ✨ Features
418
+
419
+ **General**
420
+ - Quantization and local model loading
421
+ - LoRA support (multi-LoRA, scales, library lookup), including LyCORIS LoKr on FLUX.1 and FLUX.2
422
+ - Metadata export + reuse, plus prompt file support
423
+
424
+ **Model-specific highlights**
425
+ - Text-to-image and image-to-image generation.
426
+ - LoRA finetuning
427
+ - In-context editing, multi-image editing, and virtual try-on
428
+ - ControlNet (Canny), depth conditioning, fill/inpainting, and Redux
429
+ - Upscaling (SeedVR2 and Flux ControlNet)
430
+ - Depth map extraction and FIBO prompt tooling (VLM inspire/refine)
431
+
432
+ See the [common README](src/mflux/models/common/README.md) for detailed usage and examples, and use the model section above to browse specific models and capabilities.
433
+
434
+ > [!NOTE]
435
+ > As MFLUX supports a wide variety of CLI tools and options, the easiest way to navigate the CLI in 2026 is to use a coding agent (like [Cursor](https://cursor.com), [Claude Code](https://www.anthropic.com/claude-code), or similar). Ask questions like: β€œCan you help me generate an image using z-image?”
436
+
437
+
438
+ ---
439
+
440
+ <a id="related-projects"></a>
441
+
442
+ ### 🌱 Related projects
443
+
444
+ - [MindCraft Studio](https://themindstudio.cc/mindcraft#models) β€” macOS app built on mflux by [@shaoju](https://github.com/shaoju)
445
+ - [Mflux-ComfyUI](https://github.com/raysers/Mflux-ComfyUI) by [@raysers](https://github.com/raysers)
446
+ - [MFLUX-WEBUI](https://github.com/CharafChnioune/MFLUX-WEBUI) by [@CharafChnioune](https://github.com/CharafChnioune)
447
+ - [mflux-fasthtml](https://github.com/anthonywu/mflux-fasthtml) by [@anthonywu](https://github.com/anthonywu)
448
+ - [mflux-streamlit](https://github.com/elitexp/mflux-streamlit) by [@elitexp](https://github.com/elitexp)
449
+ - [mlx-taef](https://github.com/IonDen/mlx-taef) β€” TAESD/TAEF tiny-autoencoder live previews and low-memory FLUX decode for mflux, by [@IonDen](https://github.com/IonDen)
450
+ - [mlx-teacache](https://github.com/IonDen/mlx-teacache) β€” TeaCache step-skipping to speed up FLUX generation in mflux, by [@IonDen](https://github.com/IonDen)
451
+
452
+ ---
453
+
454
+ ### πŸ™ Acknowledgements
455
+
456
+ MFLUX would not be possible without the great work of:
457
+
458
+ - The MLX Team for [MLX](https://github.com/ml-explore/mlx) and [MLX examples](https://github.com/ml-explore/mlx-examples)
459
+ - Black Forest Labs for the [FLUX project](https://github.com/black-forest-labs/flux)
460
+ - Bria for the [FIBO project](https://huggingface.co/briaai/FIBO)
461
+ - Tongyi Lab for the [Z-Image project](https://tongyi-mai.github.io/Z-Image-blog/)
462
+ - Baidu for the [ERNIE-Image project](https://huggingface.co/baidu/ERNIE-Image)
463
+ - Ideogram for the [Ideogram 4 project](https://huggingface.co/ideogram-ai/ideogram-4-fp8)
464
+ - Krea.ai for the [Krea 2 project](https://www.krea.ai/blog/krea-2-technical-report)
465
+ - Qwen Team for the [Qwen Image project](https://qwen.ai/blog?id=a6f483777144685d33cd3d2af95136fcbeb57652&from=research.research-list)
466
+ - ByteDance, @numz and @adrientoupet for the [SeedVR2 project](https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler)
467
+ - Hugging Face for the [Diffusers library implementations](https://github.com/huggingface/diffusers)
468
+ - Depth Pro authors for the [Depth Pro model](https://github.com/apple/ml-depth-pro?tab=readme-ov-file#citation)
469
+ - The MLX community and all [contributors and testers](https://github.com/filipstrand/mflux/graphs/contributors)
470
+
471
+ ---
472
+
473
+ ### βš–οΈ License
474
+
475
+ This project is licensed under the [MIT License](LICENSE).