mlx-gen 0.17.5.post2__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 (593) hide show
  1. mlx_gen-0.17.5.post2/LICENSE +21 -0
  2. mlx_gen-0.17.5.post2/PKG-INFO +261 -0
  3. mlx_gen-0.17.5.post2/README.md +187 -0
  4. mlx_gen-0.17.5.post2/pyproject.toml +177 -0
  5. mlx_gen-0.17.5.post2/src/mflux/__init__.py +6 -0
  6. mlx_gen-0.17.5.post2/src/mflux/callbacks/__init__.py +0 -0
  7. mlx_gen-0.17.5.post2/src/mflux/callbacks/callback.py +53 -0
  8. mlx_gen-0.17.5.post2/src/mflux/callbacks/callback_manager.py +91 -0
  9. mlx_gen-0.17.5.post2/src/mflux/callbacks/callback_registry.py +44 -0
  10. mlx_gen-0.17.5.post2/src/mflux/callbacks/callbacks.py +79 -0
  11. mlx_gen-0.17.5.post2/src/mflux/callbacks/generation_context.py +75 -0
  12. mlx_gen-0.17.5.post2/src/mflux/callbacks/instances/__init__.py +0 -0
  13. mlx_gen-0.17.5.post2/src/mflux/callbacks/instances/battery_saver.py +83 -0
  14. mlx_gen-0.17.5.post2/src/mflux/callbacks/instances/canny_saver.py +29 -0
  15. mlx_gen-0.17.5.post2/src/mflux/callbacks/instances/depth_saver.py +32 -0
  16. mlx_gen-0.17.5.post2/src/mflux/callbacks/instances/memory_saver.py +87 -0
  17. mlx_gen-0.17.5.post2/src/mflux/callbacks/instances/stepwise_handler.py +109 -0
  18. mlx_gen-0.17.5.post2/src/mflux/cli/__init__.py +0 -0
  19. mlx_gen-0.17.5.post2/src/mflux/cli/completions/README.md +144 -0
  20. mlx_gen-0.17.5.post2/src/mflux/cli/completions/__init__.py +0 -0
  21. mlx_gen-0.17.5.post2/src/mflux/cli/completions/generator.py +467 -0
  22. mlx_gen-0.17.5.post2/src/mflux/cli/completions/install.py +197 -0
  23. mlx_gen-0.17.5.post2/src/mflux/cli/defaults/__init__.py +0 -0
  24. mlx_gen-0.17.5.post2/src/mflux/cli/defaults/defaults.py +57 -0
  25. mlx_gen-0.17.5.post2/src/mflux/cli/parser/__init__.py +0 -0
  26. mlx_gen-0.17.5.post2/src/mflux/cli/parser/parsers.py +391 -0
  27. mlx_gen-0.17.5.post2/src/mflux/models/__init__.py +0 -0
  28. mlx_gen-0.17.5.post2/src/mflux/models/common/README.md +626 -0
  29. mlx_gen-0.17.5.post2/src/mflux/models/common/__init__.py +0 -0
  30. mlx_gen-0.17.5.post2/src/mflux/models/common/cli/__init__.py +0 -0
  31. mlx_gen-0.17.5.post2/src/mflux/models/common/cli/info.py +34 -0
  32. mlx_gen-0.17.5.post2/src/mflux/models/common/cli/lora_library.py +26 -0
  33. mlx_gen-0.17.5.post2/src/mflux/models/common/cli/save.py +46 -0
  34. mlx_gen-0.17.5.post2/src/mflux/models/common/cli/train.py +41 -0
  35. mlx_gen-0.17.5.post2/src/mflux/models/common/config/__init__.py +4 -0
  36. mlx_gen-0.17.5.post2/src/mflux/models/common/config/config.py +164 -0
  37. mlx_gen-0.17.5.post2/src/mflux/models/common/config/model_config.py +566 -0
  38. mlx_gen-0.17.5.post2/src/mflux/models/common/latent_creator/__init__.py +0 -0
  39. mlx_gen-0.17.5.post2/src/mflux/models/common/latent_creator/latent_creator.py +85 -0
  40. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/__init__.py +0 -0
  41. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/layer/__init__.py +0 -0
  42. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/layer/fused_linear_lora_layer.py +20 -0
  43. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/layer/linear_lora_layer.py +53 -0
  44. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/mapping/__init__.py +0 -0
  45. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/mapping/lora_loader.py +307 -0
  46. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/mapping/lora_mapping.py +21 -0
  47. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/mapping/lora_saver.py +82 -0
  48. mlx_gen-0.17.5.post2/src/mflux/models/common/lora/mapping/lora_transforms.py +101 -0
  49. mlx_gen-0.17.5.post2/src/mflux/models/common/resolution/__init__.py +6 -0
  50. mlx_gen-0.17.5.post2/src/mflux/models/common/resolution/actions.py +39 -0
  51. mlx_gen-0.17.5.post2/src/mflux/models/common/resolution/config_resolution.py +134 -0
  52. mlx_gen-0.17.5.post2/src/mflux/models/common/resolution/lora_resolution.py +321 -0
  53. mlx_gen-0.17.5.post2/src/mflux/models/common/resolution/path_resolution.py +183 -0
  54. mlx_gen-0.17.5.post2/src/mflux/models/common/resolution/quantization_resolution.py +52 -0
  55. mlx_gen-0.17.5.post2/src/mflux/models/common/schedulers/__init__.py +76 -0
  56. mlx_gen-0.17.5.post2/src/mflux/models/common/schedulers/base_scheduler.py +15 -0
  57. mlx_gen-0.17.5.post2/src/mflux/models/common/schedulers/flow_match_euler_discrete_scheduler.py +127 -0
  58. mlx_gen-0.17.5.post2/src/mflux/models/common/schedulers/linear_scheduler.py +58 -0
  59. mlx_gen-0.17.5.post2/src/mflux/models/common/schedulers/seedvr2_euler_scheduler.py +58 -0
  60. mlx_gen-0.17.5.post2/src/mflux/models/common/tokenizer/__init__.py +17 -0
  61. mlx_gen-0.17.5.post2/src/mflux/models/common/tokenizer/tokenizer.py +188 -0
  62. mlx_gen-0.17.5.post2/src/mflux/models/common/tokenizer/tokenizer_loader.py +471 -0
  63. mlx_gen-0.17.5.post2/src/mflux/models/common/tokenizer/tokenizer_output.py +11 -0
  64. mlx_gen-0.17.5.post2/src/mflux/models/common/training/__init__.py +0 -0
  65. mlx_gen-0.17.5.post2/src/mflux/models/common/training/_example/train.json +43 -0
  66. mlx_gen-0.17.5.post2/src/mflux/models/common/training/adapters/__init__.py +3 -0
  67. mlx_gen-0.17.5.post2/src/mflux/models/common/training/adapters/base.py +53 -0
  68. mlx_gen-0.17.5.post2/src/mflux/models/common/training/dataset/__init__.py +5 -0
  69. mlx_gen-0.17.5.post2/src/mflux/models/common/training/dataset/batch.py +33 -0
  70. mlx_gen-0.17.5.post2/src/mflux/models/common/training/dataset/data_cache.py +123 -0
  71. mlx_gen-0.17.5.post2/src/mflux/models/common/training/dataset/dataset.py +13 -0
  72. mlx_gen-0.17.5.post2/src/mflux/models/common/training/dataset/disk_backed_data.py +46 -0
  73. mlx_gen-0.17.5.post2/src/mflux/models/common/training/dataset/iterator.py +151 -0
  74. mlx_gen-0.17.5.post2/src/mflux/models/common/training/lora/__init__.py +8 -0
  75. mlx_gen-0.17.5.post2/src/mflux/models/common/training/lora/path_util.py +57 -0
  76. mlx_gen-0.17.5.post2/src/mflux/models/common/training/lora/target_injector.py +49 -0
  77. mlx_gen-0.17.5.post2/src/mflux/models/common/training/optimization/__init__.py +3 -0
  78. mlx_gen-0.17.5.post2/src/mflux/models/common/training/optimization/optimizer.py +53 -0
  79. mlx_gen-0.17.5.post2/src/mflux/models/common/training/runner.py +191 -0
  80. mlx_gen-0.17.5.post2/src/mflux/models/common/training/state/__init__.py +3 -0
  81. mlx_gen-0.17.5.post2/src/mflux/models/common/training/state/training_spec.py +684 -0
  82. mlx_gen-0.17.5.post2/src/mflux/models/common/training/state/training_state.py +225 -0
  83. mlx_gen-0.17.5.post2/src/mflux/models/common/training/state/zip_util.py +49 -0
  84. mlx_gen-0.17.5.post2/src/mflux/models/common/training/statistics/__init__.py +3 -0
  85. mlx_gen-0.17.5.post2/src/mflux/models/common/training/statistics/plotter.py +706 -0
  86. mlx_gen-0.17.5.post2/src/mflux/models/common/training/statistics/statistics.py +46 -0
  87. mlx_gen-0.17.5.post2/src/mflux/models/common/training/trainer.py +255 -0
  88. mlx_gen-0.17.5.post2/src/mflux/models/common/training/utils.py +77 -0
  89. mlx_gen-0.17.5.post2/src/mflux/models/common/vae/__init__.py +4 -0
  90. mlx_gen-0.17.5.post2/src/mflux/models/common/vae/tiling_config.py +12 -0
  91. mlx_gen-0.17.5.post2/src/mflux/models/common/vae/vae_tiler.py +216 -0
  92. mlx_gen-0.17.5.post2/src/mflux/models/common/vae/vae_util.py +72 -0
  93. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/__init__.py +14 -0
  94. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/loading/__init__.py +0 -0
  95. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/loading/loaded_weights.py +40 -0
  96. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/loading/weight_applier.py +141 -0
  97. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/loading/weight_definition.py +63 -0
  98. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/loading/weight_loader.py +338 -0
  99. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/mapping/__init__.py +10 -0
  100. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/mapping/weight_mapper.py +198 -0
  101. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/mapping/weight_mapping.py +19 -0
  102. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/mapping/weight_transforms.py +33 -0
  103. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/saving/__init__.py +0 -0
  104. mlx_gen-0.17.5.post2/src/mflux/models/common/weights/saving/model_saver.py +99 -0
  105. mlx_gen-0.17.5.post2/src/mflux/models/common_models/__init__.py +11 -0
  106. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/__init__.py +31 -0
  107. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_attention.py +178 -0
  108. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_decoder.py +192 -0
  109. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_decoder_layer.py +64 -0
  110. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_mlp.py +17 -0
  111. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_rms_norm.py +17 -0
  112. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_rope.py +56 -0
  113. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_util.py +165 -0
  114. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_attention.py +96 -0
  115. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_block.py +40 -0
  116. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_mlp.py +27 -0
  117. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_model.py +251 -0
  118. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_patch_embed.py +41 -0
  119. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_patch_merger.py +29 -0
  120. mlx_gen-0.17.5.post2/src/mflux/models/common_models/qwen3_vl/qwen3_vl_vision_rotary_embedding.py +15 -0
  121. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/README.md +33 -0
  122. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/__init__.py +0 -0
  123. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/cli/__init__.py +0 -0
  124. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/cli/save_depth.py +25 -0
  125. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/depth_pro_initializer.py +21 -0
  126. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/__init__.py +0 -0
  127. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/decoder/__init__.py +0 -0
  128. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/decoder/feature_fusion_block_2d.py +26 -0
  129. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/decoder/multires_conv_decoder.py +51 -0
  130. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/decoder/residual_block.py +36 -0
  131. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/depth_pro.py +78 -0
  132. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/depth_pro_model.py +19 -0
  133. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/depth_pro_util.py +73 -0
  134. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/__init__.py +0 -0
  135. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/attention.py +35 -0
  136. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/dino_vision_transformer.py +41 -0
  137. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/layer_scale.py +15 -0
  138. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/mlp.py +15 -0
  139. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/patch_embed.py +13 -0
  140. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/dino_v2/transformer_block.py +22 -0
  141. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/encoder/__init__.py +0 -0
  142. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/encoder/depth_pro_encoder.py +111 -0
  143. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/encoder/upsample_block.py +51 -0
  144. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/head/__init__.py +0 -0
  145. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/model/head/fov_head.py +25 -0
  146. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/weights/__init__.py +0 -0
  147. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/weights/depth_pro_weight_definition.py +34 -0
  148. mlx_gen-0.17.5.post2/src/mflux/models/depth_pro/weights/depth_pro_weight_mapping.py +307 -0
  149. mlx_gen-0.17.5.post2/src/mflux/models/fibo/README.md +535 -0
  150. mlx_gen-0.17.5.post2/src/mflux/models/fibo/__init__.py +0 -0
  151. mlx_gen-0.17.5.post2/src/mflux/models/fibo/cli/__init__.py +0 -0
  152. mlx_gen-0.17.5.post2/src/mflux/models/fibo/cli/fibo_edit.py +146 -0
  153. mlx_gen-0.17.5.post2/src/mflux/models/fibo/cli/fibo_generate.py +88 -0
  154. mlx_gen-0.17.5.post2/src/mflux/models/fibo/fibo_initializer.py +67 -0
  155. mlx_gen-0.17.5.post2/src/mflux/models/fibo/latent_creator/__init__.py +0 -0
  156. mlx_gen-0.17.5.post2/src/mflux/models/fibo/latent_creator/fibo_latent_creator.py +29 -0
  157. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/__init__.py +0 -0
  158. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/__init__.py +7 -0
  159. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/prompt_encoder.py +190 -0
  160. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_attention.py +130 -0
  161. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_encoder_layer.py +64 -0
  162. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_mlp.py +30 -0
  163. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_rms_norm.py +17 -0
  164. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_rope.py +31 -0
  165. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_text_encoder/smol_lm3_3b_text_encoder.py +105 -0
  166. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/__init__.py +3 -0
  167. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/bria_fibo_timesteps.py +38 -0
  168. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/feed_forward.py +28 -0
  169. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/fibo_ada_layer_norm_zero.py +31 -0
  170. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/fibo_embed_nd.py +50 -0
  171. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/fibo_gelu.py +14 -0
  172. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/fibo_joint_attention.py +115 -0
  173. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/fibo_single_attention.py +80 -0
  174. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/joint_transformer_block.py +76 -0
  175. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/single_transformer_block.py +55 -0
  176. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/text_projection.py +10 -0
  177. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/time_embed.py +17 -0
  178. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_transformer/transformer.py +246 -0
  179. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/__init__.py +0 -0
  180. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/__init__.py +15 -0
  181. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_attention_block.py +48 -0
  182. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_causal_conv_3d.py +42 -0
  183. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_mid_block.py +22 -0
  184. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_resample.py +64 -0
  185. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_residual_block.py +35 -0
  186. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/common/wan_2_2_rms_norm.py +32 -0
  187. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/decoder/__init__.py +3 -0
  188. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_decoder_3d.py +58 -0
  189. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_dup_up_3d.py +53 -0
  190. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_residual_up_block.py +60 -0
  191. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/decoder/wan_2_2_up_block.py +34 -0
  192. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/encoder/__init__.py +3 -0
  193. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/encoder/wan_2_2_avg_down_3d.py +75 -0
  194. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/encoder/wan_2_2_down_block.py +57 -0
  195. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/encoder/wan_2_2_encoder_3d.py +75 -0
  196. mlx_gen-0.17.5.post2/src/mflux/models/fibo/model/fibo_vae/wan_2_2_vae.py +111 -0
  197. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/__init__.py +0 -0
  198. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/edit/__init__.py +3 -0
  199. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/edit/fibo_edit.py +159 -0
  200. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/edit/util.py +143 -0
  201. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/txt2img/__init__.py +0 -0
  202. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/txt2img/fibo.py +160 -0
  203. mlx_gen-0.17.5.post2/src/mflux/models/fibo/variants/txt2img/util.py +24 -0
  204. mlx_gen-0.17.5.post2/src/mflux/models/fibo/weights/__init__.py +4 -0
  205. mlx_gen-0.17.5.post2/src/mflux/models/fibo/weights/fibo_weight_definition.py +78 -0
  206. mlx_gen-0.17.5.post2/src/mflux/models/fibo/weights/fibo_weight_mapping.py +605 -0
  207. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/__init__.py +0 -0
  208. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/cli/__init__.py +0 -0
  209. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/cli/fibo_inspire.py +46 -0
  210. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/cli/fibo_refine.py +43 -0
  211. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/fibo_vlm_initializer.py +55 -0
  212. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/model/__init__.py +0 -0
  213. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/model/fibo_vlm.py +567 -0
  214. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/model/util.py +42 -0
  215. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/tokenizer/__init__.py +1 -0
  216. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/tokenizer/qwen2vl_image_processor.py +14 -0
  217. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/tokenizer/qwen2vl_processor.py +205 -0
  218. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/weights/__init__.py +0 -0
  219. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/weights/fibo_vlm_weight_definition.py +72 -0
  220. mlx_gen-0.17.5.post2/src/mflux/models/fibo_vlm/weights/fibo_vlm_weight_mapping.py +218 -0
  221. mlx_gen-0.17.5.post2/src/mflux/models/flux/README.md +663 -0
  222. mlx_gen-0.17.5.post2/src/mflux/models/flux/__init__.py +0 -0
  223. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/__init__.py +0 -0
  224. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_concept.py +69 -0
  225. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_concept_from_image.py +68 -0
  226. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate.py +75 -0
  227. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_controlnet.py +74 -0
  228. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_depth.py +66 -0
  229. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_fill.py +65 -0
  230. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_in_context_catvton.py +79 -0
  231. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_in_context_dev.py +83 -0
  232. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_in_context_edit.py +85 -0
  233. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_kontext.py +76 -0
  234. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_generate_redux.py +74 -0
  235. mlx_gen-0.17.5.post2/src/mflux/models/flux/cli/flux_upscale.py +68 -0
  236. mlx_gen-0.17.5.post2/src/mflux/models/flux/flux_initializer.py +221 -0
  237. mlx_gen-0.17.5.post2/src/mflux/models/flux/latent_creator/__init__.py +0 -0
  238. mlx_gen-0.17.5.post2/src/mflux/models/flux/latent_creator/flux_latent_creator.py +22 -0
  239. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/__init__.py +0 -0
  240. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/__init__.py +0 -0
  241. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/__init__.py +0 -0
  242. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_embeddings.py +17 -0
  243. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_encoder.py +14 -0
  244. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_encoder_layer.py +25 -0
  245. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_mlp.py +19 -0
  246. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_sdpa_attention.py +42 -0
  247. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/clip_text_model.py +32 -0
  248. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/clip_encoder/encoder_clip.py +16 -0
  249. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/prompt_encoder.py +32 -0
  250. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/__init__.py +0 -0
  251. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_attention.py +18 -0
  252. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_block.py +18 -0
  253. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_dense_relu_dense.py +27 -0
  254. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_encoder.py +20 -0
  255. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_feed_forward.py +17 -0
  256. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_layer_norm.py +18 -0
  257. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_text_encoder/t5_encoder/t5_self_attention.py +70 -0
  258. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/__init__.py +0 -0
  259. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/ada_layer_norm_continuous.py +20 -0
  260. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/ada_layer_norm_zero.py +21 -0
  261. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/ada_layer_norm_zero_single.py +18 -0
  262. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/common/__init__.py +0 -0
  263. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/common/attention_utils.py +99 -0
  264. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/embed_nd.py +31 -0
  265. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/feed_forward.py +16 -0
  266. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/guidance_embedder.py +15 -0
  267. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/joint_attention.py +84 -0
  268. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/joint_transformer_block.py +91 -0
  269. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/single_block_attention.py +44 -0
  270. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/single_transformer_block.py +58 -0
  271. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/text_embedder.py +15 -0
  272. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/time_text_embed.py +43 -0
  273. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/timestep_embedder.py +15 -0
  274. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_transformer/transformer.py +190 -0
  275. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/__init__.py +0 -0
  276. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/common/__init__.py +0 -0
  277. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/common/attention.py +40 -0
  278. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/common/resnet_block_2d.py +72 -0
  279. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/common/unet_mid_block.py +21 -0
  280. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/__init__.py +0 -0
  281. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/conv_in.py +18 -0
  282. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/conv_norm_out.py +21 -0
  283. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/conv_out.py +18 -0
  284. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/decoder.py +100 -0
  285. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/up_block_1_or_2.py +26 -0
  286. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/up_block_3.py +26 -0
  287. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/up_block_4.py +20 -0
  288. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/decoder/up_sampler.py +27 -0
  289. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/__init__.py +0 -0
  290. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/conv_in.py +18 -0
  291. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/conv_norm_out.py +19 -0
  292. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/conv_out.py +18 -0
  293. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/down_block_1.py +24 -0
  294. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/down_block_2.py +24 -0
  295. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/down_block_3.py +24 -0
  296. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/down_block_4.py +18 -0
  297. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/down_sampler.py +19 -0
  298. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/encoder/encoder.py +36 -0
  299. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/flux_vae/vae.py +32 -0
  300. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/redux_encoder/__init__.py +0 -0
  301. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/redux_encoder/redux_encoder.py +12 -0
  302. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/__init__.py +0 -0
  303. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_encoder.py +16 -0
  304. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_encoder_layer.py +29 -0
  305. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_mlp.py +15 -0
  306. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_multi_head_attention_pooling_head.py +22 -0
  307. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_sdpa_attention.py +38 -0
  308. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_vision_embeddings.py +35 -0
  309. mlx_gen-0.17.5.post2/src/mflux/models/flux/model/siglip_vision_transformer/siglip_vision_transformer.py +24 -0
  310. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/__init__.py +0 -0
  311. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/__init__.py +1 -0
  312. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/attention_data.py +66 -0
  313. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/concept_util.py +90 -0
  314. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/flux_concept.py +174 -0
  315. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/flux_concept_from_image.py +193 -0
  316. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/joint_attention_concept.py +125 -0
  317. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/joint_transformer_block_concept.py +112 -0
  318. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/concept_attention/transformer_concept.py +88 -0
  319. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/controlnet/__init__.py +0 -0
  320. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/controlnet/controlnet_util.py +52 -0
  321. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/controlnet/flux_controlnet.py +173 -0
  322. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/controlnet/transformer_controlnet.py +130 -0
  323. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/depth/__init__.py +0 -0
  324. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/depth/depth_util.py +67 -0
  325. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/depth/flux_depth.py +153 -0
  326. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/fill/__init__.py +0 -0
  327. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/fill/flux_fill.py +152 -0
  328. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/fill/mask_util.py +58 -0
  329. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/__init__.py +0 -0
  330. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/flux_in_context_dev.py +195 -0
  331. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/flux_in_context_fill.py +158 -0
  332. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/utils/__init__.py +0 -0
  333. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/utils/in_context_fill_util.py +28 -0
  334. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/utils/in_context_loras.py +32 -0
  335. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/in_context/utils/in_context_mask_util.py +88 -0
  336. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/kontext/__init__.py +0 -0
  337. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/kontext/flux_kontext.py +152 -0
  338. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/kontext/kontext_util.py +87 -0
  339. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/redux/__init__.py +0 -0
  340. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/redux/flux_redux.py +185 -0
  341. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/redux/redux_util.py +70 -0
  342. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/txt2img/__init__.py +0 -0
  343. mlx_gen-0.17.5.post2/src/mflux/models/flux/variants/txt2img/flux.py +168 -0
  344. mlx_gen-0.17.5.post2/src/mflux/models/flux/weights/__init__.py +4 -0
  345. mlx_gen-0.17.5.post2/src/mflux/models/flux/weights/flux_lora_mapping.py +576 -0
  346. mlx_gen-0.17.5.post2/src/mflux/models/flux/weights/flux_weight_definition.py +163 -0
  347. mlx_gen-0.17.5.post2/src/mflux/models/flux/weights/flux_weight_mapping.py +817 -0
  348. mlx_gen-0.17.5.post2/src/mflux/models/flux2/README.md +155 -0
  349. mlx_gen-0.17.5.post2/src/mflux/models/flux2/__init__.py +4 -0
  350. mlx_gen-0.17.5.post2/src/mflux/models/flux2/cli/__init__.py +1 -0
  351. mlx_gen-0.17.5.post2/src/mflux/models/flux2/cli/flux2_edit_generate.py +87 -0
  352. mlx_gen-0.17.5.post2/src/mflux/models/flux2/cli/flux2_generate.py +81 -0
  353. mlx_gen-0.17.5.post2/src/mflux/models/flux2/flux2_initializer.py +80 -0
  354. mlx_gen-0.17.5.post2/src/mflux/models/flux2/latent_creator/__init__.py +3 -0
  355. mlx_gen-0.17.5.post2/src/mflux/models/flux2/latent_creator/flux2_latent_creator.py +96 -0
  356. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/__init__.py +5 -0
  357. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_text_encoder/__init__.py +4 -0
  358. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_text_encoder/prompt_encoder.py +63 -0
  359. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_text_encoder/qwen3_text_encoder.py +124 -0
  360. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_text_encoder/qwen3_text_rotary_embedding.py +29 -0
  361. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/__init__.py +3 -0
  362. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/attention.py +78 -0
  363. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/feed_forward.py +27 -0
  364. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/modulation.py +17 -0
  365. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/parallel_self_attention.py +51 -0
  366. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/pos_embed.py +31 -0
  367. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/single_transformer_block.py +29 -0
  368. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/timestep_guidance_embeddings.py +39 -0
  369. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/transformer.py +133 -0
  370. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_transformer/transformer_block.py +57 -0
  371. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/__init__.py +3 -0
  372. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/__init__.py +15 -0
  373. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/attention.py +36 -0
  374. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/batch_norm_stats.py +11 -0
  375. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/downsample_2d.py +14 -0
  376. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/resnet_block_2d.py +33 -0
  377. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/unet_mid_block.py +22 -0
  378. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/common/upsample_2d.py +16 -0
  379. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/decoder/__init__.py +3 -0
  380. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/decoder/conv_in.py +12 -0
  381. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/decoder/conv_norm_out.py +14 -0
  382. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/decoder/conv_out.py +12 -0
  383. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/decoder/decoder.py +60 -0
  384. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/decoder/up_decoder_block.py +35 -0
  385. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/encoder/__init__.py +3 -0
  386. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/encoder/conv_in.py +12 -0
  387. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/encoder/conv_norm_out.py +14 -0
  388. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/encoder/conv_out.py +12 -0
  389. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/encoder/down_encoder_block.py +36 -0
  390. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/encoder/encoder.py +60 -0
  391. mlx_gen-0.17.5.post2/src/mflux/models/flux2/model/flux2_vae/vae.py +58 -0
  392. mlx_gen-0.17.5.post2/src/mflux/models/flux2/training_adapter/flux2_base_training_adapter.py +129 -0
  393. mlx_gen-0.17.5.post2/src/mflux/models/flux2/training_adapter/flux2_edit_training_adapter.py +101 -0
  394. mlx_gen-0.17.5.post2/src/mflux/models/flux2/training_adapter/flux2_training_adapter.py +68 -0
  395. mlx_gen-0.17.5.post2/src/mflux/models/flux2/variants/__init__.py +4 -0
  396. mlx_gen-0.17.5.post2/src/mflux/models/flux2/variants/edit/__init__.py +3 -0
  397. mlx_gen-0.17.5.post2/src/mflux/models/flux2/variants/edit/flux2_klein_edit.py +207 -0
  398. mlx_gen-0.17.5.post2/src/mflux/models/flux2/variants/edit/flux2_klein_edit_helpers.py +129 -0
  399. mlx_gen-0.17.5.post2/src/mflux/models/flux2/variants/txt2img/__init__.py +3 -0
  400. mlx_gen-0.17.5.post2/src/mflux/models/flux2/variants/txt2img/flux2_klein.py +281 -0
  401. mlx_gen-0.17.5.post2/src/mflux/models/flux2/weights/__init__.py +5 -0
  402. mlx_gen-0.17.5.post2/src/mflux/models/flux2/weights/flux2_lora_mapping.py +1157 -0
  403. mlx_gen-0.17.5.post2/src/mflux/models/flux2/weights/flux2_weight_definition.py +64 -0
  404. mlx_gen-0.17.5.post2/src/mflux/models/flux2/weights/flux2_weight_mapping.py +547 -0
  405. mlx_gen-0.17.5.post2/src/mflux/models/qwen/README.md +256 -0
  406. mlx_gen-0.17.5.post2/src/mflux/models/qwen/__init__.py +0 -0
  407. mlx_gen-0.17.5.post2/src/mflux/models/qwen/cli/__init__.py +0 -0
  408. mlx_gen-0.17.5.post2/src/mflux/models/qwen/cli/qwen_image_edit_generate.py +89 -0
  409. mlx_gen-0.17.5.post2/src/mflux/models/qwen/cli/qwen_image_generate.py +73 -0
  410. mlx_gen-0.17.5.post2/src/mflux/models/qwen/latent_creator/__init__.py +0 -0
  411. mlx_gen-0.17.5.post2/src/mflux/models/qwen/latent_creator/qwen_latent_creator.py +17 -0
  412. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/__init__.py +0 -0
  413. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/__init__.py +1 -0
  414. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_attention.py +132 -0
  415. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_encoder.py +113 -0
  416. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_encoder_layer.py +54 -0
  417. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_mlp.py +17 -0
  418. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_patch_merger.py +32 -0
  419. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_prompt_encoder.py +42 -0
  420. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_rms_norm.py +17 -0
  421. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_rope.py +36 -0
  422. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_text_encoder.py +72 -0
  423. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_attention.py +74 -0
  424. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_block.py +24 -0
  425. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_language_encoder.py +54 -0
  426. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_language_prompt_encoder.py +94 -0
  427. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_mlp.py +15 -0
  428. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_patch_embed.py +34 -0
  429. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_rotary_embedding.py +16 -0
  430. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_text_encoder/qwen_vision_transformer.py +149 -0
  431. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/__init__.py +0 -0
  432. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_attention.py +158 -0
  433. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_feed_forward.py +15 -0
  434. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_layer_norm.py +18 -0
  435. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_rope.py +113 -0
  436. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_time_text_embed.py +17 -0
  437. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_timestep_embedding.py +15 -0
  438. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_timesteps.py +34 -0
  439. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_transformer.py +139 -0
  440. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_transformer_block.py +76 -0
  441. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_transformer/qwen_transformer_rms_norm.py +23 -0
  442. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/__init__.py +0 -0
  443. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_attention_block_3d.py +41 -0
  444. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_causal_conv_3d.py +41 -0
  445. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_decoder_3d.py +32 -0
  446. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_down_block_3d.py +26 -0
  447. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_encoder_3d.py +65 -0
  448. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_mid_block_3d.py +26 -0
  449. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_res_block_3d.py +30 -0
  450. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_resample_3d.py +50 -0
  451. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_rms_norm.py +33 -0
  452. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_image_up_block_3d.py +26 -0
  453. mlx_gen-0.17.5.post2/src/mflux/models/qwen/model/qwen_vae/qwen_vae.py +36 -0
  454. mlx_gen-0.17.5.post2/src/mflux/models/qwen/qwen_initializer.py +119 -0
  455. mlx_gen-0.17.5.post2/src/mflux/models/qwen/tokenizer/__init__.py +2 -0
  456. mlx_gen-0.17.5.post2/src/mflux/models/qwen/tokenizer/qwen_image_processor.py +162 -0
  457. mlx_gen-0.17.5.post2/src/mflux/models/qwen/tokenizer/qwen_vision_language_processor.py +103 -0
  458. mlx_gen-0.17.5.post2/src/mflux/models/qwen/tokenizer/qwen_vision_language_tokenizer.py +142 -0
  459. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/__init__.py +0 -0
  460. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/edit/__init__.py +4 -0
  461. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/edit/qwen_edit_util.py +96 -0
  462. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/edit/qwen_image_edit.py +261 -0
  463. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/edit/qwen_prompt_rewriter.py +116 -0
  464. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/txt2img/__init__.py +0 -0
  465. mlx_gen-0.17.5.post2/src/mflux/models/qwen/variants/txt2img/qwen_image.py +174 -0
  466. mlx_gen-0.17.5.post2/src/mflux/models/qwen/weights/__init__.py +4 -0
  467. mlx_gen-0.17.5.post2/src/mflux/models/qwen/weights/qwen_lora_mapping.py +246 -0
  468. mlx_gen-0.17.5.post2/src/mflux/models/qwen/weights/qwen_weight_definition.py +316 -0
  469. mlx_gen-0.17.5.post2/src/mflux/models/qwen/weights/qwen_weight_mapping.py +858 -0
  470. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/README.md +153 -0
  471. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/__init__.py +6 -0
  472. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/cli/__init__.py +0 -0
  473. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/cli/seedvr2_upscale.py +119 -0
  474. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/latent_creator/__init__.py +0 -0
  475. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/latent_creator/seedvr2_latent_creator.py +28 -0
  476. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/__init__.py +0 -0
  477. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_text_encoder/__init__.py +0 -0
  478. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_text_encoder/embeddings/pos_emb.safetensors +0 -0
  479. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_text_encoder/text_embeddings.py +21 -0
  480. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/__init__.py +0 -0
  481. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/ada_modulation.py +68 -0
  482. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/attention.py +143 -0
  483. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/mm_swiglu.py +43 -0
  484. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/patch_in.py +33 -0
  485. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/patch_out.py +31 -0
  486. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/rms_norm.py +17 -0
  487. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/rope.py +203 -0
  488. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/swiglu_mlp.py +44 -0
  489. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/time_embedding.py +41 -0
  490. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/transformer.py +129 -0
  491. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/transformer_block.py +110 -0
  492. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_transformer/window.py +125 -0
  493. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/__init__.py +0 -0
  494. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/common/__init__.py +0 -0
  495. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/common/attention_3d.py +44 -0
  496. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/common/conv3d.py +55 -0
  497. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/__init__.py +0 -0
  498. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/decoder_3d.py +78 -0
  499. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/decoder_mid_block_3d.py +30 -0
  500. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/decoder_resnet_block_3d.py +42 -0
  501. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/up_block_3d.py +37 -0
  502. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/decoder/upsample_3d.py +48 -0
  503. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/__init__.py +0 -0
  504. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/down_block_3d.py +32 -0
  505. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/downsample_3d.py +25 -0
  506. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/encoder_3d.py +74 -0
  507. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/mid_block_3d.py +24 -0
  508. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/encoder/resnet_block_3d.py +43 -0
  509. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/model/seedvr2_vae/vae.py +50 -0
  510. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/seedvr2_initializer.py +55 -0
  511. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/variants/__init__.py +0 -0
  512. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/variants/upscale/__init__.py +0 -0
  513. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/variants/upscale/seedvr2.py +114 -0
  514. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/variants/upscale/seedvr2_util.py +235 -0
  515. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/weights/__init__.py +0 -0
  516. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/weights/seedvr2_weight_definition.py +117 -0
  517. mlx_gen-0.17.5.post2/src/mflux/models/seedvr2/weights/seedvr2_weight_mapping.py +692 -0
  518. mlx_gen-0.17.5.post2/src/mflux/models/z_image/README.md +130 -0
  519. mlx_gen-0.17.5.post2/src/mflux/models/z_image/__init__.py +4 -0
  520. mlx_gen-0.17.5.post2/src/mflux/models/z_image/cli/__init__.py +0 -0
  521. mlx_gen-0.17.5.post2/src/mflux/models/z_image/cli/z_image_generate.py +78 -0
  522. mlx_gen-0.17.5.post2/src/mflux/models/z_image/cli/z_image_turbo_generate.py +70 -0
  523. mlx_gen-0.17.5.post2/src/mflux/models/z_image/latent_creator/__init__.py +3 -0
  524. mlx_gen-0.17.5.post2/src/mflux/models/z_image/latent_creator/z_image_latent_creator.py +31 -0
  525. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/__init__.py +2 -0
  526. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/__init__.py +2 -0
  527. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/attention.py +76 -0
  528. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/encoder_layer.py +35 -0
  529. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/mlp.py +13 -0
  530. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/prompt_encoder.py +17 -0
  531. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/rope.py +16 -0
  532. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_text_encoder/text_encoder.py +81 -0
  533. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/__init__.py +3 -0
  534. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/attention.py +90 -0
  535. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/context_block.py +23 -0
  536. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/feed_forward.py +13 -0
  537. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/final_layer.py +16 -0
  538. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/rope_embedder.py +37 -0
  539. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/timestep_embedder.py +37 -0
  540. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/transformer.py +201 -0
  541. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_transformer/transformer_block.py +35 -0
  542. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/__init__.py +3 -0
  543. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/common/__init__.py +5 -0
  544. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/common/attention.py +48 -0
  545. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/common/resnet_block_2d.py +70 -0
  546. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/common/unet_mid_block.py +21 -0
  547. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/__init__.py +3 -0
  548. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/conv_in.py +19 -0
  549. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/conv_norm_out.py +21 -0
  550. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/conv_out.py +19 -0
  551. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/decoder.py +36 -0
  552. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/up_decoder_block.py +47 -0
  553. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/decoder/up_sampler.py +27 -0
  554. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/__init__.py +3 -0
  555. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/conv_in.py +19 -0
  556. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/conv_norm_out.py +15 -0
  557. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/conv_out.py +19 -0
  558. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/down_encoder_block.py +41 -0
  559. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/down_sampler.py +20 -0
  560. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/encoder/encoder.py +35 -0
  561. mlx_gen-0.17.5.post2/src/mflux/models/z_image/model/z_image_vae/vae.py +32 -0
  562. mlx_gen-0.17.5.post2/src/mflux/models/z_image/training_adapter/z_image_training_adapter.py +145 -0
  563. mlx_gen-0.17.5.post2/src/mflux/models/z_image/variants/__init__.py +5 -0
  564. mlx_gen-0.17.5.post2/src/mflux/models/z_image/variants/z_image.py +213 -0
  565. mlx_gen-0.17.5.post2/src/mflux/models/z_image/weights/__init__.py +4 -0
  566. mlx_gen-0.17.5.post2/src/mflux/models/z_image/weights/z_image_lora_mapping.py +457 -0
  567. mlx_gen-0.17.5.post2/src/mflux/models/z_image/weights/z_image_weight_definition.py +65 -0
  568. mlx_gen-0.17.5.post2/src/mflux/models/z_image/weights/z_image_weight_mapping.py +615 -0
  569. mlx_gen-0.17.5.post2/src/mflux/models/z_image/z_image_initializer.py +79 -0
  570. mlx_gen-0.17.5.post2/src/mflux/release/__init__.py +0 -0
  571. mlx_gen-0.17.5.post2/src/mflux/release/changelog_parser.py +116 -0
  572. mlx_gen-0.17.5.post2/src/mflux/release/git_operations.py +59 -0
  573. mlx_gen-0.17.5.post2/src/mflux/release/github_api.py +66 -0
  574. mlx_gen-0.17.5.post2/src/mflux/release/pypi_publisher.py +165 -0
  575. mlx_gen-0.17.5.post2/src/mflux/release/release_manager.py +92 -0
  576. mlx_gen-0.17.5.post2/src/mflux/release/release_script.py +30 -0
  577. mlx_gen-0.17.5.post2/src/mflux/release/release_validator.py +87 -0
  578. mlx_gen-0.17.5.post2/src/mflux/utils/__init__.py +0 -0
  579. mlx_gen-0.17.5.post2/src/mflux/utils/apple_silicon.py +33 -0
  580. mlx_gen-0.17.5.post2/src/mflux/utils/box_values.py +65 -0
  581. mlx_gen-0.17.5.post2/src/mflux/utils/dimension_resolver.py +45 -0
  582. mlx_gen-0.17.5.post2/src/mflux/utils/exceptions.py +49 -0
  583. mlx_gen-0.17.5.post2/src/mflux/utils/generated_image.py +269 -0
  584. mlx_gen-0.17.5.post2/src/mflux/utils/image_compare.py +76 -0
  585. mlx_gen-0.17.5.post2/src/mflux/utils/image_util.py +334 -0
  586. mlx_gen-0.17.5.post2/src/mflux/utils/info_util.py +145 -0
  587. mlx_gen-0.17.5.post2/src/mflux/utils/lora_library_util.py +100 -0
  588. mlx_gen-0.17.5.post2/src/mflux/utils/metadata_builder.py +234 -0
  589. mlx_gen-0.17.5.post2/src/mflux/utils/metadata_reader.py +94 -0
  590. mlx_gen-0.17.5.post2/src/mflux/utils/prompt_util.py +55 -0
  591. mlx_gen-0.17.5.post2/src/mflux/utils/scale_factor.py +44 -0
  592. mlx_gen-0.17.5.post2/src/mflux/utils/version_util.py +32 -0
  593. mlx_gen-0.17.5.post2/src/mlxgen/__init__.py +5 -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,261 @@
1
+ Metadata-Version: 2.3
2
+ Name: mlx-gen
3
+ Version: 0.17.5.post2
4
+ Summary: MLX native implementations of state-of-the-art generative image models.
5
+ Keywords: flux,ai,ml,transformers,mlx,huggingface,apple-silicon,diffusers,qwen,qwen-image,seedvr2,z-image
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: AbstractVision
69
+ Requires-Python: >=3.10
70
+ Project-URL: homepage, https://github.com/lpalbou/mflux
71
+ Project-URL: upstream, https://github.com/filipstrand/mflux
72
+ Provides-Extra: dev
73
+ Description-Content-Type: text/markdown
74
+
75
+ ![image](src/mflux/assets/logo.jpg)
76
+
77
+ [![mlx-gen](https://img.shields.io/pypi/v/mlx-gen?label=mlx-gen&logo=pypi&logoColor=white)](https://pypi.org/project/mlx-gen/)
78
+ [![MLX](https://img.shields.io/pypi/v/mlx?label=MLX&logo=pypi&logoColor=white)](https://pypi.org/project/mlx/)
79
+ [![CI](https://github.com/lpalbou/mflux/actions/workflows/tests.yml/badge.svg)](https://github.com/lpalbou/mflux/actions/workflows/tests.yml)
80
+
81
+ ### About
82
+
83
+ Run the latest state-of-the-art generative image models locally on your Mac in native MLX!
84
+
85
+ ### Table of contents
86
+
87
+ - [💡 Philosophy](#-philosophy)
88
+ - [💿 Installation](#-installation)
89
+ - [🎨 Models](#-models)
90
+ - [✨ Features](#-features)
91
+ - [🌱 Related projects](#related-projects)
92
+ - [🙏 Acknowledgements](#-acknowledgements)
93
+ - [⚖️ License](#%EF%B8%8F-license)
94
+
95
+ ---
96
+
97
+ ### 💡 Philosophy
98
+
99
+ 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.
100
+
101
+ ---
102
+
103
+ ### 💿 Installation
104
+ If you haven't already, [install `uv`](https://github.com/astral-sh/uv?tab=readme-ov-file#installation), then run:
105
+
106
+ ```sh
107
+ uv tool install --upgrade mlx-gen
108
+ ```
109
+
110
+ This fork is published on PyPI as `mlx-gen`. The canonical Python module and CLI commands remain `mflux`, with a lightweight `mlxgen` import alias for application code.
111
+
112
+ After installation, the following command shows all available MFLUX CLI commands:
113
+
114
+ ```sh
115
+ uv tool list
116
+ ```
117
+
118
+ To generate your first image using, for example, the z-image-turbo model, run
119
+
120
+ ```
121
+ mflux-generate-z-image-turbo \
122
+ --prompt "A puffin standing on a cliff" \
123
+ --width 1280 \
124
+ --height 500 \
125
+ --seed 42 \
126
+ --steps 9 \
127
+ -q 8
128
+ ```
129
+
130
+ ![Puffin](src/mflux/assets/puffin.png)
131
+
132
+ 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.
133
+
134
+ <details>
135
+ <summary>Python API</summary>
136
+
137
+ Create a standalone `generate.py` script with inline `uv` dependencies:
138
+
139
+ ```python
140
+ #!/usr/bin/env -S uv run --script
141
+ # /// script
142
+ # requires-python = ">=3.10"
143
+ # dependencies = [
144
+ # "mlx-gen",
145
+ # ]
146
+ # ///
147
+ from mlxgen.models.z_image import ZImageTurbo
148
+
149
+ model = ZImageTurbo(quantize=8)
150
+ image = model.generate_image(
151
+ prompt="A puffin standing on a cliff",
152
+ seed=42,
153
+ num_inference_steps=9,
154
+ width=1280,
155
+ height=500,
156
+ )
157
+ image.save("puffin.png")
158
+ ```
159
+
160
+ Run it with:
161
+
162
+ ```sh
163
+ uv run generate.py
164
+ ```
165
+
166
+ 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.
167
+ </details>
168
+
169
+ <details>
170
+ <summary>⚠️ Troubleshooting: hf_transfer error</summary>
171
+
172
+ 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:
173
+
174
+ ```sh
175
+ uv tool install --upgrade mlx-gen --with hf_transfer
176
+ ```
177
+
178
+ This will enable faster model downloads from Hugging Face.
179
+
180
+ </details>
181
+
182
+ <details>
183
+ <summary>DGX / NVIDIA (uv tool install)</summary>
184
+
185
+ ```sh
186
+ uv tool install --python 3.13 mlx-gen
187
+ ```
188
+ </details>
189
+
190
+ ---
191
+
192
+ ### 🎨 Models
193
+
194
+ MFLUX supports the following model families. They have different strengths and weaknesses; see each model’s README for full usage details.
195
+
196
+ | Model | Release date | Size | Type | Training | Description |
197
+ | --- | --- | --- | --- | --- | --- |
198
+ |[Z-Image](src/mflux/models/z_image/README.md) | Nov 2025 | 6B | Distilled & Base | Yes | Fast, small, very good quality and realism. |
199
+ |[FLUX.2](src/mflux/models/flux2/README.md) | Jan 2026 | 4B & 9B | Distilled & Base | Yes | Fastest + smallest with very good qaility and edit capabilities. |
200
+ |[FIBO](src/mflux/models/fibo/README.md) | Oct 2025+ | 8B | Distilled & Base | No | Very good JSON-based prompt understanding. Has edit capabilities. |
201
+ |[SeedVR2](src/mflux/models/seedvr2/README.md) | Jun 2025 | 3B & 7B | — | No | Best upscaling model. |
202
+ |[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 |
203
+ |[Depth Pro](src/mflux/models/depth_pro/README.md) | Oct 2024 | — | — | No | Very fast and accurate depth estimation model from Apple. |
204
+ |[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 |
205
+
206
+ ---
207
+
208
+ ### ✨ Features
209
+
210
+ **General**
211
+ - Quantization and local model loading
212
+ - LoRA support (multi-LoRA, scales, library lookup)
213
+ - Metadata export + reuse, plus prompt file support
214
+
215
+ **Model-specific highlights**
216
+ - Text-to-image and image-to-image generation.
217
+ - LoRA finetuning
218
+ - In-context editing, multi-image editing, and virtual try-on
219
+ - ControlNet (Canny), depth conditioning, fill/inpainting, and Redux
220
+ - Upscaling (SeedVR2 and Flux ControlNet)
221
+ - Depth map extraction and FIBO prompt tooling (VLM inspire/refine)
222
+
223
+ 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.
224
+
225
+ > [!NOTE]
226
+ > 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?”
227
+
228
+
229
+ ---
230
+
231
+ <a id="related-projects"></a>
232
+
233
+ ### 🌱 Related projects
234
+
235
+ - [MindCraft Studio](https://themindstudio.cc/mindcraft#models) — macOS app built on mflux by [@shaoju](https://github.com/shaoju)
236
+ - [Mflux-ComfyUI](https://github.com/raysers/Mflux-ComfyUI) by [@raysers](https://github.com/raysers)
237
+ - [MFLUX-WEBUI](https://github.com/CharafChnioune/MFLUX-WEBUI) by [@CharafChnioune](https://github.com/CharafChnioune)
238
+ - [mflux-fasthtml](https://github.com/anthonywu/mflux-fasthtml) by [@anthonywu](https://github.com/anthonywu)
239
+ - [mflux-streamlit](https://github.com/elitexp/mflux-streamlit) by [@elitexp](https://github.com/elitexp)
240
+
241
+ ---
242
+
243
+ ### 🙏 Acknowledgements
244
+
245
+ MFLUX would not be possible without the great work of:
246
+
247
+ - The MLX Team for [MLX](https://github.com/ml-explore/mlx) and [MLX examples](https://github.com/ml-explore/mlx-examples)
248
+ - Black Forest Labs for the [FLUX project](https://github.com/black-forest-labs/flux)
249
+ - Bria for the [FIBO project](https://huggingface.co/briaai/FIBO)
250
+ - Tongyi Lab for the [Z-Image project](https://tongyi-mai.github.io/Z-Image-blog/)
251
+ - Qwen Team for the [Qwen Image project](https://qwen.ai/blog?id=a6f483777144685d33cd3d2af95136fcbeb57652&from=research.research-list)
252
+ - ByteDance, @numz and @adrientoupet for the [SeedVR2 project](https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler)
253
+ - Hugging Face for the [Diffusers library implementations](https://github.com/huggingface/diffusers)
254
+ - Depth Pro authors for the [Depth Pro model](https://github.com/apple/ml-depth-pro?tab=readme-ov-file#citation)
255
+ - The MLX community and all [contributors and testers](https://github.com/filipstrand/mflux/graphs/contributors)
256
+
257
+ ---
258
+
259
+ ### ⚖️ License
260
+
261
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,187 @@
1
+ ![image](src/mflux/assets/logo.jpg)
2
+
3
+ [![mlx-gen](https://img.shields.io/pypi/v/mlx-gen?label=mlx-gen&logo=pypi&logoColor=white)](https://pypi.org/project/mlx-gen/)
4
+ [![MLX](https://img.shields.io/pypi/v/mlx?label=MLX&logo=pypi&logoColor=white)](https://pypi.org/project/mlx/)
5
+ [![CI](https://github.com/lpalbou/mflux/actions/workflows/tests.yml/badge.svg)](https://github.com/lpalbou/mflux/actions/workflows/tests.yml)
6
+
7
+ ### About
8
+
9
+ Run the latest state-of-the-art generative image models locally on your Mac in native MLX!
10
+
11
+ ### Table of contents
12
+
13
+ - [💡 Philosophy](#-philosophy)
14
+ - [💿 Installation](#-installation)
15
+ - [🎨 Models](#-models)
16
+ - [✨ Features](#-features)
17
+ - [🌱 Related projects](#related-projects)
18
+ - [🙏 Acknowledgements](#-acknowledgements)
19
+ - [⚖️ License](#%EF%B8%8F-license)
20
+
21
+ ---
22
+
23
+ ### 💡 Philosophy
24
+
25
+ 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.
26
+
27
+ ---
28
+
29
+ ### 💿 Installation
30
+ If you haven't already, [install `uv`](https://github.com/astral-sh/uv?tab=readme-ov-file#installation), then run:
31
+
32
+ ```sh
33
+ uv tool install --upgrade mlx-gen
34
+ ```
35
+
36
+ This fork is published on PyPI as `mlx-gen`. The canonical Python module and CLI commands remain `mflux`, with a lightweight `mlxgen` import alias for application code.
37
+
38
+ After installation, the following command shows all available MFLUX CLI commands:
39
+
40
+ ```sh
41
+ uv tool list
42
+ ```
43
+
44
+ To generate your first image using, for example, the z-image-turbo model, run
45
+
46
+ ```
47
+ mflux-generate-z-image-turbo \
48
+ --prompt "A puffin standing on a cliff" \
49
+ --width 1280 \
50
+ --height 500 \
51
+ --seed 42 \
52
+ --steps 9 \
53
+ -q 8
54
+ ```
55
+
56
+ ![Puffin](src/mflux/assets/puffin.png)
57
+
58
+ 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.
59
+
60
+ <details>
61
+ <summary>Python API</summary>
62
+
63
+ Create a standalone `generate.py` script with inline `uv` dependencies:
64
+
65
+ ```python
66
+ #!/usr/bin/env -S uv run --script
67
+ # /// script
68
+ # requires-python = ">=3.10"
69
+ # dependencies = [
70
+ # "mlx-gen",
71
+ # ]
72
+ # ///
73
+ from mlxgen.models.z_image import ZImageTurbo
74
+
75
+ model = ZImageTurbo(quantize=8)
76
+ image = model.generate_image(
77
+ prompt="A puffin standing on a cliff",
78
+ seed=42,
79
+ num_inference_steps=9,
80
+ width=1280,
81
+ height=500,
82
+ )
83
+ image.save("puffin.png")
84
+ ```
85
+
86
+ Run it with:
87
+
88
+ ```sh
89
+ uv run generate.py
90
+ ```
91
+
92
+ 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.
93
+ </details>
94
+
95
+ <details>
96
+ <summary>⚠️ Troubleshooting: hf_transfer error</summary>
97
+
98
+ 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:
99
+
100
+ ```sh
101
+ uv tool install --upgrade mlx-gen --with hf_transfer
102
+ ```
103
+
104
+ This will enable faster model downloads from Hugging Face.
105
+
106
+ </details>
107
+
108
+ <details>
109
+ <summary>DGX / NVIDIA (uv tool install)</summary>
110
+
111
+ ```sh
112
+ uv tool install --python 3.13 mlx-gen
113
+ ```
114
+ </details>
115
+
116
+ ---
117
+
118
+ ### 🎨 Models
119
+
120
+ MFLUX supports the following model families. They have different strengths and weaknesses; see each model’s README for full usage details.
121
+
122
+ | Model | Release date | Size | Type | Training | Description |
123
+ | --- | --- | --- | --- | --- | --- |
124
+ |[Z-Image](src/mflux/models/z_image/README.md) | Nov 2025 | 6B | Distilled & Base | Yes | Fast, small, very good quality and realism. |
125
+ |[FLUX.2](src/mflux/models/flux2/README.md) | Jan 2026 | 4B & 9B | Distilled & Base | Yes | Fastest + smallest with very good qaility and edit capabilities. |
126
+ |[FIBO](src/mflux/models/fibo/README.md) | Oct 2025+ | 8B | Distilled & Base | No | Very good JSON-based prompt understanding. Has edit capabilities. |
127
+ |[SeedVR2](src/mflux/models/seedvr2/README.md) | Jun 2025 | 3B & 7B | — | No | Best upscaling model. |
128
+ |[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 |
129
+ |[Depth Pro](src/mflux/models/depth_pro/README.md) | Oct 2024 | — | — | No | Very fast and accurate depth estimation model from Apple. |
130
+ |[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 |
131
+
132
+ ---
133
+
134
+ ### ✨ Features
135
+
136
+ **General**
137
+ - Quantization and local model loading
138
+ - LoRA support (multi-LoRA, scales, library lookup)
139
+ - Metadata export + reuse, plus prompt file support
140
+
141
+ **Model-specific highlights**
142
+ - Text-to-image and image-to-image generation.
143
+ - LoRA finetuning
144
+ - In-context editing, multi-image editing, and virtual try-on
145
+ - ControlNet (Canny), depth conditioning, fill/inpainting, and Redux
146
+ - Upscaling (SeedVR2 and Flux ControlNet)
147
+ - Depth map extraction and FIBO prompt tooling (VLM inspire/refine)
148
+
149
+ 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.
150
+
151
+ > [!NOTE]
152
+ > 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?”
153
+
154
+
155
+ ---
156
+
157
+ <a id="related-projects"></a>
158
+
159
+ ### 🌱 Related projects
160
+
161
+ - [MindCraft Studio](https://themindstudio.cc/mindcraft#models) — macOS app built on mflux by [@shaoju](https://github.com/shaoju)
162
+ - [Mflux-ComfyUI](https://github.com/raysers/Mflux-ComfyUI) by [@raysers](https://github.com/raysers)
163
+ - [MFLUX-WEBUI](https://github.com/CharafChnioune/MFLUX-WEBUI) by [@CharafChnioune](https://github.com/CharafChnioune)
164
+ - [mflux-fasthtml](https://github.com/anthonywu/mflux-fasthtml) by [@anthonywu](https://github.com/anthonywu)
165
+ - [mflux-streamlit](https://github.com/elitexp/mflux-streamlit) by [@elitexp](https://github.com/elitexp)
166
+
167
+ ---
168
+
169
+ ### 🙏 Acknowledgements
170
+
171
+ MFLUX would not be possible without the great work of:
172
+
173
+ - The MLX Team for [MLX](https://github.com/ml-explore/mlx) and [MLX examples](https://github.com/ml-explore/mlx-examples)
174
+ - Black Forest Labs for the [FLUX project](https://github.com/black-forest-labs/flux)
175
+ - Bria for the [FIBO project](https://huggingface.co/briaai/FIBO)
176
+ - Tongyi Lab for the [Z-Image project](https://tongyi-mai.github.io/Z-Image-blog/)
177
+ - Qwen Team for the [Qwen Image project](https://qwen.ai/blog?id=a6f483777144685d33cd3d2af95136fcbeb57652&from=research.research-list)
178
+ - ByteDance, @numz and @adrientoupet for the [SeedVR2 project](https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler)
179
+ - Hugging Face for the [Diffusers library implementations](https://github.com/huggingface/diffusers)
180
+ - Depth Pro authors for the [Depth Pro model](https://github.com/apple/ml-depth-pro?tab=readme-ov-file#citation)
181
+ - The MLX community and all [contributors and testers](https://github.com/filipstrand/mflux/graphs/contributors)
182
+
183
+ ---
184
+
185
+ ### ⚖️ License
186
+
187
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,177 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.7.19,<0.8.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [tool.uv.build-backend]
6
+ default-excludes = true
7
+ module-name = ["mflux", "mlxgen"]
8
+ namespace = true
9
+ source-exclude = [
10
+ "**/assets/**",
11
+ "**/models/common/training/_example/images/**",
12
+ "**/optimization/_loss_derivation/**",
13
+ ]
14
+
15
+ [project]
16
+ name = "mlx-gen"
17
+ version = "0.17.5.post2"
18
+ description = "MLX native implementations of state-of-the-art generative image models."
19
+ readme = "README.md"
20
+ keywords = ["flux", "ai", "ml", "transformers", "mlx", "huggingface", "apple-silicon", "diffusers", "qwen", "qwen-image", "seedvr2", "z-image"]
21
+ authors = [{ name = "Filip Strand", email = "strand.filip@gmail.com" }]
22
+ maintainers = [{ name = "AbstractVision" }]
23
+ license = { file = "LICENSE" }
24
+ requires-python = ">=3.10"
25
+ dependencies = [
26
+ "filelock>=3.20.1",
27
+ "fonttools>=4.60.2",
28
+ "huggingface-hub>=1.1.6,<2.0",
29
+ "hf-transfer>=0.1.9,<1.0",
30
+ "matplotlib>=3.9.2,<4.0",
31
+ "mlx>=0.27.0,<0.32.0; sys_platform=='darwin'",
32
+ "mlx[cuda13]>=0.30.3,<0.32.0; sys_platform=='linux'",
33
+ "numpy>=2.0.1,<3.0",
34
+ "opencv-python>=4.10.0,<5.0",
35
+ "piexif>=1.1.3,<2.0",
36
+ "pillow>=12.1.1",
37
+ "platformdirs>=4.0,<5.0",
38
+ "regex>=2024.11.6",
39
+ "requests>=2.32.4",
40
+ "safetensors>=0.4.4,<1.0",
41
+ "sentencepiece>=0.2.1,<1.0",
42
+ "tokenizers>=0.20.3; python_version>='3.13'",
43
+ "toml>=0.10.2,<1.0",
44
+ "torch>=2.7.1,<3.0",
45
+ "torch>=2.8.0,<3.0; python_version>='3.13'",
46
+ "tqdm>=4.66.5,<5.0",
47
+ "transformers>=5.0.0,<6.0",
48
+ "twine>=6.1.0,<7.0",
49
+ "urllib3>=2.6.0",
50
+ "protobuf>=4.25.0,<8.0",
51
+ ]
52
+ classifiers = [
53
+ "Intended Audience :: Developers",
54
+ "Operating System :: MacOS",
55
+ "Operating System :: POSIX :: Linux",
56
+ "Programming Language :: Python :: 3",
57
+ "Programming Language :: Python :: 3.10",
58
+ "Programming Language :: Python :: 3.11",
59
+ "Programming Language :: Python :: 3.12",
60
+ "Programming Language :: Python :: 3.13",
61
+ "Programming Language :: Python :: 3.14",
62
+ ]
63
+
64
+ [project.optional-dependencies]
65
+ dev = [
66
+ "matplotlib>3.10,<4.0",
67
+ "pytest>=8.3.0,<9.0",
68
+ "pytest-timer>=1.0,<2.0",
69
+ "mlx==0.31.0; sys_platform=='darwin'",
70
+ "mlx[cuda13]==0.30.3; sys_platform=='linux'",
71
+ ]
72
+
73
+ [project.urls]
74
+ homepage = "https://github.com/lpalbou/mflux"
75
+ upstream = "https://github.com/filipstrand/mflux"
76
+
77
+ [project.scripts]
78
+ mflux-generate = "mflux.models.flux.cli.flux_generate:main"
79
+ mflux-generate-flux2 = "mflux.models.flux2.cli.flux2_generate:main"
80
+ mflux-generate-flux2-edit = "mflux.models.flux2.cli.flux2_edit_generate:main"
81
+ mflux-generate-controlnet = "mflux.models.flux.cli.flux_generate_controlnet:main"
82
+ mflux-generate-in-context = "mflux.models.flux.cli.flux_generate_in_context_dev:main"
83
+ mflux-generate-in-context-edit = "mflux.models.flux.cli.flux_generate_in_context_edit:main"
84
+ mflux-generate-in-context-catvton = "mflux.models.flux.cli.flux_generate_in_context_catvton:main"
85
+ mflux-generate-fill = "mflux.models.flux.cli.flux_generate_fill:main"
86
+ mflux-generate-depth = "mflux.models.flux.cli.flux_generate_depth:main"
87
+ mflux-generate-redux = "mflux.models.flux.cli.flux_generate_redux:main"
88
+ mflux-generate-kontext = "mflux.models.flux.cli.flux_generate_kontext:main"
89
+ mflux-generate-qwen = "mflux.models.qwen.cli.qwen_image_generate:main"
90
+ mflux-generate-qwen-edit = "mflux.models.qwen.cli.qwen_image_edit_generate:main"
91
+ mflux-generate-fibo = "mflux.models.fibo.cli.fibo_generate:main"
92
+ mflux-generate-fibo-edit = "mflux.models.fibo.cli.fibo_edit:main"
93
+ mflux-generate-z-image = "mflux.models.z_image.cli.z_image_generate:main"
94
+ mflux-generate-z-image-turbo = "mflux.models.z_image.cli.z_image_turbo_generate:main"
95
+ mflux-refine-fibo = "mflux.models.fibo_vlm.cli.fibo_refine:main"
96
+ mflux-inspire-fibo = "mflux.models.fibo_vlm.cli.fibo_inspire:main"
97
+ mflux-concept = "mflux.models.flux.cli.flux_concept:main"
98
+ mflux-concept-from-image = "mflux.models.flux.cli.flux_concept_from_image:main"
99
+ mflux-save = "mflux.models.common.cli.save:main"
100
+ mflux-save-depth = "mflux.models.depth_pro.cli.save_depth:main"
101
+ mflux-train = "mflux.models.common.cli.train:main"
102
+ mflux-upscale-controlnet = "mflux.models.flux.cli.flux_upscale:main"
103
+ mflux-upscale-seedvr2 = "mflux.models.seedvr2.cli.seedvr2_upscale:main"
104
+ mflux-lora-library = "mflux.models.common.cli.lora_library:main"
105
+ mflux-info = "mflux.models.common.cli.info:main"
106
+ mflux-completions = "mflux.cli.completions.install:main"
107
+
108
+
109
+ [tool.ruff]
110
+ line-length = 120
111
+ indent-width = 4
112
+ target-version = "py310"
113
+ respect-gitignore = true
114
+
115
+ [tool.ruff.lint]
116
+ select = ["BLE", "E4", "E7", "E9", "F", "I", "ICN", "LOG", "PERF", "W"]
117
+ ignore = []
118
+ fixable = ["ALL"]
119
+ unfixable = []
120
+ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
121
+
122
+ [tool.ruff.format]
123
+ quote-style = "double"
124
+ indent-style = "space"
125
+ skip-magic-trailing-comma = false
126
+ line-ending = "auto"
127
+ docstring-code-format = false
128
+ docstring-code-line-length = "dynamic"
129
+
130
+ [tool.pytest.ini_options]
131
+ testpaths = ["tests"]
132
+ python_files = "test_*.py"
133
+ addopts = '-v --failed-first --showlocals --tb=long --full-trace -m "not high_memory_requirement"'
134
+ filterwarnings = [
135
+ "ignore::DeprecationWarning:transformers\\.models\\.clip\\.tokenization_clip",
136
+ "ignore:builtin type SwigPyPacked has no __module__ attribute:DeprecationWarning",
137
+ "ignore:builtin type SwigPyObject has no __module__ attribute:DeprecationWarning",
138
+ "ignore:builtin type swigvarlink has no __module__ attribute:DeprecationWarning",
139
+ ]
140
+ markers = [
141
+ "fast: marks tests as fast (no image generation)",
142
+ "slow: marks tests as slow (generates images)",
143
+ "high_memory_requirement: marks tests that require high memory (deselect with '-m \"not high_memory_requirement\"')",
144
+ ]
145
+
146
+ [tool.ruff.lint.isort]
147
+ case-sensitive = false
148
+ combine-as-imports = true
149
+ force-wrap-aliases = true
150
+ from-first = false
151
+ known-first-party = ["src"]
152
+ relative-imports-order = "furthest-to-closest"
153
+ section-order = [
154
+ "future",
155
+ "standard-library",
156
+ "third-party",
157
+ "first-party",
158
+ "local-folder",
159
+ ]
160
+
161
+ [tool.mypy]
162
+ disable_error_code = [
163
+ "annotation-unchecked",
164
+ "arg-type",
165
+ "assignment",
166
+ "attr-defined",
167
+ "import-untyped",
168
+ "index",
169
+ "union-attr",
170
+ "return",
171
+ "return-value",
172
+ "var-annotated",
173
+ ]
174
+ error_summary = true
175
+ ignore_missing_imports = true
176
+ implicit_optional = true
177
+ python_version = "3.12"
@@ -0,0 +1,6 @@
1
+ import os
2
+
3
+ # Set TOKENIZERS_PARALLELISM to avoid fork warning
4
+ # This must be set before any tokenizers are imported/used
5
+ if "TOKENIZERS_PARALLELISM" not in os.environ:
6
+ os.environ["TOKENIZERS_PARALLELISM"] = "false"
File without changes