500kg ryanlee-dev commited on
Commit
7b6142f
·
0 Parent(s):

MiniMax-H3-Image

Browse files

Co-authored-by: ryanlee-dev <ryanlee-dev@users.noreply.huggingface.co>

This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +41 -0
  2. LICENSE +84 -0
  3. README.md +347 -0
  4. assets/minimax-h3-image.jpg +3 -0
  5. assets/showcase/art.jpg +3 -0
  6. assets/showcase/char.jpg +3 -0
  7. assets/showcase/edit_map.jpg +3 -0
  8. assets/showcase/edit_multi.jpg +3 -0
  9. assets/showcase/edit_render.jpg +3 -0
  10. assets/showcase/photo.jpg +3 -0
  11. assets/showcase/scene.jpg +3 -0
  12. assets/showcase/surreal.jpg +3 -0
  13. assets/showcase/text.jpg +3 -0
  14. assets/showcase_hero.jpg +3 -0
  15. assets/workflow_edit.jpg +3 -0
  16. assets/workflow_t2i.jpg +3 -0
  17. examples/api_generate.py +40 -0
  18. examples/context_ir.py +91 -0
  19. examples/edit.py +69 -0
  20. examples/instruction.edit.txt +1 -0
  21. examples/instruction.t2i.txt +1 -0
  22. examples/prompt.edit.txt +1 -0
  23. examples/reference1.png +3 -0
  24. examples/request.t2i.json +8 -0
  25. examples/revised_prompt.edit.txt +1 -0
  26. examples/revised_prompt.t2i.txt +1 -0
  27. examples/revised_size.edit.txt +1 -0
  28. examples/revised_size.t2i.txt +1 -0
  29. examples/t2i.py +49 -0
  30. model_index.json +45 -0
  31. pdd_config.json +12 -0
  32. pdd_fused_heads.safetensors +3 -0
  33. processor/chat_template.json +3 -0
  34. processor/merges.txt +0 -0
  35. processor/preprocessor_config.json +21 -0
  36. processor/tokenizer.json +0 -0
  37. processor/tokenizer_config.json +246 -0
  38. processor/video_preprocessor_config.json +21 -0
  39. processor/vocab.json +0 -0
  40. tokenizer/merges.txt +0 -0
  41. tokenizer/tokenizer.json +0 -0
  42. tokenizer/tokenizer_config.json +246 -0
  43. tokenizer/vocab.json +0 -0
  44. transformer/config.json +28 -0
  45. transformer/model-00001-of-00012.safetensors +3 -0
  46. transformer/model-00002-of-00012.safetensors +3 -0
  47. transformer/model-00003-of-00012.safetensors +3 -0
  48. transformer/model-00004-of-00012.safetensors +3 -0
  49. transformer/model-00005-of-00012.safetensors +3 -0
  50. transformer/model-00006-of-00012.safetensors +3 -0
.gitattributes ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.png filter=lfs diff=lfs merge=lfs -text
23
+ *.pt filter=lfs diff=lfs merge=lfs -text
24
+ *.pth filter=lfs diff=lfs merge=lfs -text
25
+ *.rar filter=lfs diff=lfs merge=lfs -text
26
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
27
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar filter=lfs diff=lfs merge=lfs -text
30
+ *.tflite filter=lfs diff=lfs merge=lfs -text
31
+ *.tgz filter=lfs diff=lfs merge=lfs -text
32
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ *.mov filter=lfs diff=lfs merge=lfs -text
39
+ *.png filter=lfs diff=lfs merge=lfs -text
40
+ *.jpg filter=lfs diff=lfs merge=lfs -text
41
+ *.webp filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MiniMax-H3-Image COMMUNITY LICENSE AGREEMENT
2
+ MiniMax-H3-Image release date/License date: November 10, 2026.
3
+ The scope of this License Agreement (this “Agreement”) is expressly limited to the “Applicable Territory” as defined below.
4
+ By clicking to accept, or by using, reproducing, modifying, distributing, running, or displaying any portion or element of the MiniMax-H3-Image Works (including through any Hosted Service) in any manner, you acknowledge and accept the terms of this Agreement, and this Agreement shall take immediate effect upon the occurrence of such act.
5
+ I. Definitions
6
+ 1. “Acceptable Use Policy” means the policy published by MiniMax in Exhibit A.
7
+ 2. “Agreement” means the terms and conditions set forth herein that govern the use, reproduction, distribution, modification, running, and display of the MiniMax-H3-Image Works or any portion or element thereof.
8
+ 3. “Applicable Territory” means worldwide, excluding the Excluded Territories.
9
+ 4. “Documentation” means the specifications, manuals, and documentation concerning MiniMax-H3-Image that are publicly released by MiniMax.
10
+ 5. “Excluded Territories” means the European Union, the United Kingdom, the Republic of Korea and the United States of America.
11
+ 6. “MiniMax-H3-Image” means the image generation model, together with its software and algorithms, including trained model weights, parameters (including optimizer states), prompt-enhancement models, inference-supporting code, and other elements thereof made publicly available by Us, as released at https://huggingface.co/MiniMaxAI/MiniMax-H3-Image.
12
+ 7. “MiniMax-H3-Image Works” means (i) the Materials, (ii) the Model Derivatives, and (iii) all derivatives thereof.
13
+ 8. “Hosted Service” means a service through which MiniMax-H3-Image or its Model Derivatives is hosted or operated and its functionality is made available to Third Parties, including via application programming interfaces (APIs), web access, or any other electronic or remote means.
14
+ 9. “Licensee,” “you,” or “your” means the natural or legal person exercising rights and/or using the MiniMax-H3-Image Works for any purpose in any field of use under this Agreement.
15
+ 10. “Materials” means, collectively, MiniMax-H3-Image and the Documentation (and any portion thereof), in each case as made available by MiniMax under this Agreement and proprietary to MiniMax.
16
+ 11. “Model Derivatives” means all of the following: (i) any modification of MiniMax-H3-Image or any Model Derivative thereof; (ii) any work based on MiniMax-H3-Image or any Model Derivative thereof; or (iii) any other machine learning model created by transferring the patterns of the weights, parameters, operational patterns, or Outputs of MiniMax-H3-Image or any Model Derivative thereof to another model, such that the latter model exhibits behavior similar to MiniMax-H3-Image or its Model Derivatives, including by distillation methods, methods using intermediate data representations, or methods based on training using synthetic-data Outputs generated by MiniMax-H3-Image or its Model Derivatives. For the avoidance of doubt, Outputs are not deemed Model Derivatives.
17
+ 12. “Output” means any result of operating or otherwise using MiniMax-H3-Image or any Model Derivatives (including through Hosted Service).
18
+ 13. “Third Party” means any natural or legal person that is not under common control with us or with you.
19
+ 14. “Including” means “including but not limited to.”
20
+ 15. “We,” “Us” or “MiniMax” means Nanonoble Pte. Ltd..
21
+ II. Grant of Rights
22
+ Solely within the Applicable Territory, we grant you a non-exclusive, non-transferable, royalty-free, limited license to use, reproduce, distribute, create derivative works (including Model Derivatives), and modify the Materials in accordance with the terms of this Agreement and the Acceptable Use Policy, based on the intellectual property and other rights owned by MiniMax that are embodied in or used by the Materials. You shall not violate (or encourage or permit any person to violate) any term of this Agreement or the Acceptable Use Policy.
23
+ We will continuously evaluate the applicable laws, regulations and compliance requirements for the Excluded Territories. In the meantime, should any person in such Excluded Territories be interested in deploying our models, you are welcome to contact us about obtaining a license, which will be granted based on robust controls and guardrails for purposes of complying with the laws, regulations and compliance requirements of the Excluded Territories.
24
+ III. Distribution and Redistribution
25
+ Subject to and conditioned on your continuing compliance with this Agreement, including its territorial restrictions and the Acceptable Use Policy, and solely within the Applicable Territory, you may distribute or make available the MiniMax-H3-Image Works to Third Parties within the Applicable Territory; provided, that all of the following conditions are met:
26
+ 1. You must provide a copy of this Agreement to all such Third Parties who receive the MiniMax-H3-Image Works or use your products or services related thereto;
27
+ 2. You must cause any modified files to carry prominent notices stating that you have modified such files;
28
+ 3. You are encouraged to:
29
+ a. display a notice on any product or service developed using MiniMax-H3-Image indicating that the product or service is “Powered by MiniMax-H3-Image”;
30
+ b. add an AI-generation identifier to files produced using generative AI models including MiniMax-H3-Image; and
31
+ c. publish at least one technical blog post or a public statement describing your experience using MiniMax-H3-Image Works;
32
+ 4. All distributions to Third Parties (other than through Hosted Service) must be accompanied by a “NOTICE” text file containing the following notice:
33
+ “MiniMax-H3-Image is licensed under the MiniMax-H3-Image Community License Agreement, Copyright © 2026 MiniMax. All Rights Reserved.”
34
+ You may add your own copyright notices on your modifications; except as provided in this Section and in Section V, however, you may not impose additional or different terms and conditions on the use, reproduction, or distribution of your modifications or of any aggregate Model Derivatives, and your use, reproduction, modification, distribution, running, and display of the work must otherwise comply with the terms and conditions of this Agreement (including the provisions concerning the Applicable Territory). If you receive the MiniMax-H3-Image Works from a Licensee as part of an integrated end-user product, the provisions of Section III of this Agreement do not apply to you, but Section V and Exhibit A remain applicable.
35
+ IV. Additional Commercial Terms
36
+ 1. You shall obtain a separate, prior written authorization from MiniMax by sending a request through https://platform.minimax.io/license, if the Annualized Revenue of you and/or your affiliates exceeds 1 Million USD, or, you provide Hosted Service(s) to any Third Parties.
37
+ 2. You shall prominently display “MiniMax-H3-Image”on the user interface of commercial product or service that uses MiniMax-H3-Image or MiniMax-H3-Image Works.
38
+ V. Use Restrictions
39
+ 1. Your use of the MiniMax-H3-Image Works must comply with applicable laws and regulations (including trade-compliance laws and regulations) and must comply with the Acceptable Use Policy for the MiniMax-H3-Image Works, which is incorporated into this Agreement by reference.
40
+ 2. Before providing access to the MiniMax-H3-Image Works or any product, service, or Hosted Service incorporating them, you must bind each recipient or user to enforceable terms at least as protective as the use restrictions in this Section V and Exhibit A, and you must notify each recipient or user that those restrictions apply.
41
+ 3. You may not use the MiniMax-H3-Image Works or any of their Outputs or results to improve any other artificial intelligence model (other than MiniMax-H3-Image or its Model Derivatives).
42
+ 4. You may not use, reproduce, modify, distribute, or display the MiniMax-H3-Image Works or any of their Outputs or results outside the Applicable Territory. Any such use outside the Applicable Territory is not authorized by this Agreement.
43
+ 5. If you provide or make available to any Third Party a product, service, or Hosted Service that permits the generation of Outputs using MiniMax-H3-Image or any Model Derivative, you must, before making that product or service available and throughout its operation, implement, maintain, test, and periodically review reasonable and proportionate technical and organizational safeguards designed to prevent and mitigate access, uses, and Outputs that violate this Section V or Exhibit A, including uses or Outputs that infringe, misappropriate, or otherwise violate any Third Party’s intellectual-property or other rights. You must not knowingly disable, materially weaken, or permit the circumvention of those safeguards. You must maintain a reasonably accessible mechanism for reporting suspected violations. Upon receiving a good-faith report or otherwise obtaining actual knowledge of a violation, you must promptly investigate and take reasonable steps within your control to stop or mitigate the violation, including removing or disabling access to offending content or services and suspending or terminating repeat violators where appropriate. You are responsible for implementing and enforcing these requirements with respect to your products, services, systems, users, and downstream recipients.
44
+ VI. Intellectual Property
45
+ 1. Subject to MiniMax’s rights in the MiniMax-H3-Image Works (and the intellectual property therein), and to your compliance with the terms and conditions of this Agreement, as between you and MiniMax, you will own the derivative works and modifications of the Materials that you have created or had created, as well as any Model Derivatives.
46
+ 2. Except for the limited license expressly granted in this paragraph, no trademark license is granted under this Agreement; with respect to MiniMax-H3-Image Works, the Licensee may not use any name or mark owned by or associated with MiniMax or any of its affiliates, except as reasonably and customarily necessary to describe and distribute the MiniMax-H3-Image Works. MiniMax hereby grants you a license to use the “MiniMax-H3-Image” mark (the “Mark”) within the Applicable Territory solely for the purpose of complying with Section III.3; provided, that you comply with all applicable trademark-protection laws. All goodwill arising from your use of the Mark shall inure to the benefit of MiniMax.
47
+ 3. If you bring or assert any suit or other legal proceeding (including a cross-claim or counterclaim in any action) against us or any other natural or legal person alleging that the Materials, any Output, or any portion of the foregoing infringes any intellectual property right or other right owned by you or for which you can obtain a license, all licenses granted to you under this Agreement will terminate as of the date such suit or proceeding is filed. You shall defend, indemnify, and hold us harmless against any Third-Party claim arising out of or related to the use or distribution of the MiniMax-H3-Image Works by you or by any Third Party.
48
+ 4. MiniMax claims no rights over the Outputs you generate. You and your users are entirely responsible for the Outputs and any subsequent use thereof.
49
+ VII. Disclaimers and Limitations of Liability
50
+ 1. We have no obligation to support, update, provide training for, or develop any further version of the MiniMax-H3-Image Works, or to grant any license with respect thereto.
51
+ 2. UNLESS AND ONLY TO THE EXTENT REQUIRED BY APPLICABLE LAW, THE MiniMax-H3-Image WORKS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED “AS IS” WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND INCLUDING ANY WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, COURSE OF DEALING, USAGE OF TRADE, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR DISTRIBUTING ANY OF THE MiniMax-H3-Image WORKS OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR OR A THIRD PARTY’S USE OR DISTRIBUTION OF ANY OF THE MiniMax-H3-Image WORKS OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT.
52
+ 3. TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL MINIMAX OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, FOR ANY DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO ANY OF THE MiniMax-H3-Image WORKS OR OUTPUTS, EVEN IF MINIMAX OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF ANY OF THE FOREGOING.
53
+ VIII. Term and Termination
54
+ 1. This Agreement is effective from the moment you accept this Agreement or begin accessing the Materials, and, subject to your compliance with its terms and conditions, will remain in effect until terminated as provided herein.
55
+ 2. If you breach any term or condition of this Agreement, we have the right to terminate this Agreement. Upon termination, you must immediately cease accessing, using, and distributing the MiniMax-H3-Image Works; delete or destroy all copies within your possession or control; and notify each downstream recipient that your authorization has ended. The obligations in the preceding sentence and Sections VI.1, VI.3, VII, and IX survive termination.
56
+ IX. Governing Law and Jurisdiction
57
+ 1. This Agreement, and any dispute arising out of or related to this Agreement, shall be governed by the laws of the Hong Kong Special Administrative Region of the People’s Republic of China, without regard to its conflict-of-laws rules. The United Nations Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
58
+ 2. Any dispute arising out of or related to this Agreement shall be subject to the exclusive jurisdiction of the courts of the Hong Kong Special Administrative Region of the People’s Republic of China with competent jurisdiction. Both MiniMax and the Licensee hereby consent to the exclusive jurisdiction of such courts for any such dispute.
59
+ Additional Note: Please note that the text-to-image prompt enhancer model (https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE, "T2I PE Model") of MiniMax-H3-Image is derived from Qwen3.8-27B licensed under Apache 2.0 License: https://huggingface.co/Qwen/Qwen3.8-27B. The T2I PE Model is part of MiniMax-H3-Image and is accordingly subject to this Agreement for the avoidance of doubt.
60
+
61
+ Exhibit A — Acceptable Use Policy
62
+ MiniMax reserves the right to update this Acceptable Use Policy from time to time.
63
+ Last revised: November 10, 2026.
64
+ MiniMax is committed to promoting the safe and fair use of its tools and features, including MiniMax-H3-Image. You agree not to use MiniMax-H3-Image, any Model Derivatives, or any Output in any of the following ways:
65
+ 1. Use outside the Applicable Territory;
66
+ 2. Use in any manner that violates any applicable national, federal, state, local, or international law, regulation, or other legal requirement, or that infringes, misappropriates, or otherwise violates any Third Party’s intellectual-property or other proprietary rights, including through unauthorized reproduction, distribution, public display, public performance, or creation of derivative works;
67
+ 3. Use in any manner that may harm yourself or others;
68
+ 4. Use to repurpose or distribute the Outputs of MiniMax-H3-Image or any Model Derivatives in order to harm yourself or others;
69
+ 5. Use to circumvent or bypass any safety guardrails or safeguards we have implemented;
70
+ 6. Use in any manner that exploits or harms, or intends to exploit or harm, minors;
71
+ 7. Use to generate or disseminate verifiably false information and/or content for the purpose of harming others or influencing elections;
72
+ 8. Use to manufacture or facilitate false online engagement, including fake reviews and other means of false online engagement;
73
+ 9. Use to intentionally defame, disparage, or otherwise harass others;
74
+ 10. Use to generate and/or disseminate malware (including ransomware) or any other content intended to damage electronic systems;
75
+ 11. Use to generate or disseminate personally identifiable information for the purpose of harming others;
76
+ 12. Use to generate or disseminate information (including images, code, posts, or articles) in or to any public environment (including via bot tweets or similar means) without clearly and prominently disclosing that such information and/or content is machine-generated;
77
+ 13. Use to impersonate another person without that person’s consent, authorization, or lawful right to do so;
78
+ 14. Use to make high-risk automated decisions in critical domains that affect individual safety, rights, or well-being (such as law enforcement, immigration, healthcare or medical services, critical-infrastructure management, product-safety components, essential services, credit, employment, housing, education, social scoring, or insurance);
79
+ 15. Use in any manner that violates or disregards the social, ethical, or moral standards of other countries or regions;
80
+ 16. Use to carry out, assist, threaten, incite, plan, advocate for, or encourage violent extremism or terrorism;
81
+ 17. Use for any purpose intended to discriminate against, or harm, individuals or groups based on protected characteristics or categories, online or offline social behavior, or known or predicted personality traits;
82
+ 18. Use to intentionally exploit the vulnerabilities of specific populations based on age, social, physical, or psychological characteristics, so as to materially distort the behavior of a member of that group in a manner that causes, or is likely to cause, physical or psychological harm to that person or to others;
83
+ 19. Use for military purposes;
84
+ 20. Use to engage in any unauthorized or unlicensed professional activity, including but not limited to financial, legal, medical or healthcare, or other professional practice.
README.md ADDED
@@ -0,0 +1,347 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: text-to-image
3
+ license: other
4
+ license_name: minimax-h3-image-community-license-agreement
5
+ license_link: LICENSE
6
+ library_name: minimax-h3
7
+ language:
8
+ - en
9
+ tags:
10
+ - text-to-image
11
+ - image-to-image
12
+ - image-editing
13
+ - image-generation
14
+ - minimax-h3
15
+ - diffusers
16
+ ---
17
+
18
+ <div align="center">
19
+ <img width="100%" src="assets/minimax-h3-image.jpg" alt="MiniMax H3 image, Open Weights">
20
+ </div>
21
+
22
+ <p align="center">
23
+ <a href="https://hailuoai.video" target="_blank"><img src="https://img.shields.io/badge/Hailuo%20AI-FF6C37?logo=minimax&logoColor=white" alt="Hailuo AI"></a>
24
+ <a href="https://platform.minimax.io" target="_blank"><img src="https://img.shields.io/badge/API-FF6C37?logo=minimax&logoColor=white" alt="API"></a>
25
+ <a href="https://www.minimax.io" target="_blank"><img src="https://img.shields.io/badge/MiniMax%20Website-FF6C37?logo=minimax&logoColor=white" alt="MiniMax Website"></a>
26
+ <a href="https://github.com/MiniMax-AI/MiniMax-H3" target="_blank"><img src="https://img.shields.io/badge/GitHub-181717?logo=github&logoColor=white" alt="GitHub"></a>
27
+ <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image" target="_blank"><img src="https://img.shields.io/badge/Hugging%20Face-FFD21E?logo=huggingface&logoColor=black" alt="Hugging Face"></a>
28
+ <br>
29
+ <a href="https://modelscope.cn/organization/minimax" target="_blank" rel="noopener noreferrer"><img alt="ModelScope MiniMax AI" src="https://img.shields.io/badge/ModelScope-MiniMax%20AI-white?labelColor=%23EF3D5D"></a>
30
+ <a href="https://platform.minimaxi.com/docs/faq/contact-us" target="_blank"><img src="https://img.shields.io/badge/WeChat-07C160?logo=wechat&logoColor=white" alt="WeChat"></a>
31
+ <a href="https://discord.com/invite/dbMxutw7tP" target="_blank"><img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
32
+ <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE"><img src="https://img.shields.io/badge/LICENSE-4CAF50?logo=creativecommons&logoColor=white" alt="LICENSE"></a>
33
+ </p>
34
+
35
+ # MiniMax-H3-Image
36
+
37
+ ## Online API
38
+
39
+ Use MiniMax-H3-Image directly via API.
40
+
41
+ - Global: [platform.minimax.io](https://platform.minimax.io/docs/guides/image-generation) | CN: [platform.minimax.cn](https://platform.minimax.cn/docs/guides/image-generation)
42
+
43
+ API docs:
44
+ - Text-to-image: [EN-docs](https://platform.minimax.io/docs/api-reference/image-generation-h3-generations), [CN-docs](https://platform.minimax.cn/docs/api-reference/image-generation-h3-generations)
45
+ - Image editing: [EN-docs](https://platform.minimax.io/docs/api-reference/image-generation-h3-edits), [CN-docs](https://platform.minimax.cn/docs/api-reference/image-generation-h3-edits)
46
+ - Prompt expansion: [EN-docs](https://platform.minimax.io/docs/api-reference/image-generation-h3-context-ir), [CN-docs](https://platform.minimax.cn/docs/api-reference/image-generation-h3-context-ir)
47
+
48
+ ## Online App
49
+
50
+ Use MiniMax-H3-Image directly via App.
51
+
52
+ - WebApp Global: [hailuoai.video](https://hailuoai.video/) | CN: [hailuoai.com](https://hailuoai.com/)
53
+ - Desktop Global: [agent.minimax.io](https://agent.minimax.io/) | CN: [agent.minimax.cn](https://agent.minimax.cn)
54
+
55
+ ## Introduction
56
+
57
+ MiniMax-H3-Image is a state-of-the-art open-source model for image generation and editing from
58
+ the [MiniMax H3](https://huggingface.co/MiniMaxAI/MiniMax-H3) family. It combines intelligent
59
+ understanding of creative intent with the ability to build visual worlds: with precise
60
+ instruction following, it develops a creative concept into concrete characters, scenes and
61
+ atmosphere. Generation and editing are unified in one checkpoint, which generates images from
62
+ text (text-to-image) and edits one or more reference images (image editing), giving creators
63
+ and developers a flexible and controllable way to create images.
64
+
65
+ It generates images of about 16 megapixels at every aspect ratio, from 4096x4096 (1:1) to
66
+ 6272x2688 (21:9), directly and without an upscaler (see [Sizes](#sizes)). The checkpoint is
67
+ distilled to 6 sampling steps (6 NFEs) with no classifier-free guidance. Its diffusion
68
+ transformer (DiT) has the H3 architecture without the audio layers, and it uses the
69
+ MiniMax-H3 text encoder unchanged.
70
+
71
+ ![Fifteen MiniMax-H3-Image text-to-image results in landscape and portrait formats: a 3D fantasy battle, a blue-green landscape painting, a tree frog, an indigo-dyed rabbit, a 3D white-haired girl, a portrait among flowers, a sci-fi city, dumplings, a highland cow, a mirror portrait, a 3D otter and sheep, a pixel art cat, a jewel beetle, giant cherries and a fisheye selfie](assets/showcase_hero.jpg)
72
+
73
+ **Highlights**
74
+
75
+ MiniMax-H3-Image brings together three core strengths: speed, image quality, and instruction
76
+ following.
77
+
78
+ 1. **16-megapixel images at a practical computational cost.** Compared with the 1–4 MP outputs
79
+ common today, 16 MP (4096 × 4096) images offer far more detail but typically require
80
+ substantially more computation. MiniMax-H3-Image keeps that computational cost manageable,
81
+ making 16 MP generation practical for everyday creation.
82
+ 2. **Rich detail. Remarkable realism.** MiniMax-H3-Image goes beyond the familiar “AI look” to
83
+ produce images with intricate detail and lifelike realism, opening up more possibilities for
84
+ creative and professional use. It brings generated imagery closer to the richness and nuance
85
+ of the real visual world.
86
+ 3. **Stronger instruction following.** Greater creative control. Great image generation goes
87
+ beyond beautiful pictures—it helps creators bring their ideas to life. MiniMax-H3-Image
88
+ delivers the strongest instruction following among open-source models and supports up to 16
89
+ reference images, giving creators more control over the final result.
90
+
91
+ ## Model Zoo
92
+
93
+ | Model | Role | Precision | Size | Hugging Face |
94
+ | --- | --- | --- | --- | --- |
95
+ | **MiniMax-H3-Image** | Text-to-image and image editing | BF16 (DiT) | 68.65 GB | [MiniMaxAI/MiniMax-H3-Image](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image) |
96
+ | **MiniMax-H3-Image-PE** (optional) | Prompt expander for text-to-image | NVFP4 | 17.9 GB | [MiniMaxAI/MiniMax-H3-Image-PE](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE) |
97
+
98
+ ## Model Architecture
99
+
100
+ <!-- TODO(release): architecture figure, e.g. assets/architecture.png, adapted from MiniMax-H3's assets/full-arch.png without the audio branch. -->
101
+
102
+ MiniMax-H3-Image follows the H3-Base design with the audio branch removed. The text
103
+ prompt and the reference images are encoded by the H3 text encoder; the reference images are
104
+ also encoded by the image VAE. All tokens form one packed sequence for a single-stream
105
+ transformer, which predicts the latent of the target image. The VAE decodes that latent
106
+ into the image.
107
+
108
+ - **Text encoder**: the full Qwen3-VL text encoder of MiniMax-H3, unchanged. The DiT reads
109
+ the hidden states of its 50th layer.
110
+ - **Image VAE**: a CNN encoder and a 2D ViT decoder (24 layers), with 16x spatial
111
+ downsampling and 24 latent channels. The DiT patchifies the latent with a 2x2 patch, so each
112
+ transformer token covers 32x32 pixels.
113
+ - **Diffusion transformer**: 33.1B parameters, a dense single-stream transformer with 50
114
+ layers (hidden size 5376, 56 attention heads, FFN size 14336) and 3D multimodal RoPE, the same
115
+ as the H3-Omni-Transformer. The weights are BF16; the embedding, timestep and output layers
116
+ are FP32.
117
+
118
+ ## Quick Start
119
+
120
+ ### Download
121
+
122
+ | Component | Content | Size |
123
+ | --- | --- | --- |
124
+ | `transformer/` | DiT: BF16, with the embedding, timestep and output layers in FP32. | 66.28 GB |
125
+ | `pdd_fused_heads.safetensors`, `pdd_config.json` | The per-step output heads that replace the transformer's output layer, and the sampling schedule. | 12 MB |
126
+ | `vae/` | Image VAE, FP32. | 2.34 GB |
127
+ | `tokenizer/`, `processor/` | Qwen3-VL tokenizer and processor, identical to MiniMax-H3. | 23 MB |
128
+ | Text encoder | Not in this repository. `model_index.json` loads it from [`MiniMaxAI/MiniMax-H3`](https://huggingface.co/MiniMaxAI/MiniMax-H3), folder `text_encoder/`. If you already have MiniMax-H3, it is not downloaded again. | 66.7 GB |
129
+
130
+ ```text
131
+ MiniMax-H3-Image/
132
+ ├── model_index.json
133
+ ├── pdd_config.json
134
+ ├── pdd_fused_heads.safetensors
135
+ ├── processor/
136
+ ├── tokenizer/
137
+ ├── transformer/
138
+ └── vae/
139
+ ```
140
+
141
+ Download this repository and the MiniMax-H3 text encoder into the Hugging Face cache:
142
+
143
+ ```bash
144
+ hf download MiniMaxAI/MiniMax-H3-Image
145
+ hf download MiniMaxAI/MiniMax-H3 --include "text_encoder/*"
146
+ # optional prompt expander
147
+ hf download MiniMaxAI/MiniMax-H3-Image-PE
148
+ ```
149
+
150
+ ### Local Deployment
151
+
152
+ We recommend the following inference frameworks to serve the model:
153
+
154
+ - [SGLang](https://docs.sglang.io/) - see [cookbook](https://docs.sglang.io/cookbook/diffusion/MiniMax/MiniMax-H3-image)
155
+ - [vLLM](https://github.com/vllm-project/vllm) - see [vllm recipes]()
156
+ - [diffusers](https://github.com/huggingface/diffusers) - see [diffusers docs]()
157
+ - [ComfyUI](https://github.com/Comfy-Org/ComfyUI) - see [Comfy tutorial](); use [T2I template]() / [Edit template]()
158
+
159
+ #### SGLang Deployment
160
+
161
+ Here we use SGLang as a deployment example. See the [MiniMax-H3-Image deployment guide](https://docs.sglang.io/cookbook/diffusion/MiniMax/MiniMax-H3-image) for
162
+ additional deployment configurations.
163
+
164
+ Start the server on one GPU:
165
+
166
+ ```bash
167
+ sglang serve --model-path MiniMaxAI/MiniMax-H3-Image --host 0.0.0.0 --port 30000 --warmup-mode off
168
+ ```
169
+
170
+ To use a local copy of the MiniMax-H3 `text_encoder/` folder instead of the Hugging Face
171
+ cache, add `--text-encoder-path <path to text_encoder>`.
172
+
173
+ For lower latency, split each request over several GPUs with sequence parallelism
174
+ (Ulysses), for example on 4 GPUs:
175
+
176
+ ```bash
177
+ sglang serve --model-path MiniMaxAI/MiniMax-H3-Image --host 0.0.0.0 --port 30000 --warmup-mode off \
178
+ --num-gpus 4 --ulysses-degree 4
179
+ ```
180
+
181
+ #### Request parameters
182
+
183
+ Text-to-image requests are JSON sent to `/v1/images/generations`. Image editing requests send
184
+ the reference images as multipart form data to `/v1/images/edits`; their order defines
185
+ `<Picture 1>`, `<Picture 2>`, and so on in the prompt. Both return the PNG in
186
+ `data[0].b64_json`. Runnable examples are in [Full Workflow](#full-workflow).
187
+
188
+ | Field | Text-to-image | Image editing | Notes |
189
+ | --- | --- | --- | --- |
190
+ | `prompt` | Required | Required | Used as given, truncated to 4096 tokens. See [Full Workflow](#full-workflow) |
191
+ | `size` | Required | Required | `WIDTHxHEIGHT`. The returned image has exactly this size; see [Sizes](#sizes) |
192
+ | `image` | — | One or more files | In upload order they are `<Picture 1>`, `<Picture 2>`, ... in the prompt |
193
+ | `seed` | Recommended | Recommended | Integer |
194
+ | `generator_device` | `cpu` recommended | `cpu` recommended | Same seed, same initial noise on every machine |
195
+ | `response_format` | `b64_json` | `b64_json` | |
196
+ | `min_generation_area` | Optional | Optional | Minimum generated area in pixels, 1024-16777216, default 4194304 (2048x2048). A smaller `size` is generated at the same aspect ratio on a larger canvas and resized back with LANCZOS; pass 1024 to turn this off. All sizes in the table below are above the default |
197
+ | `num_inference_steps` | Omit or 6 | Omit or 6 | Other values return HTTP 400 |
198
+ | `guidance_scale` | Omit or 1 | Omit or 1 | Other values return HTTP 400 |
199
+ | `negative_prompt` | Not supported | Not supported | Rejected |
200
+
201
+ #### Sizes
202
+
203
+ The effective working range of MiniMax-H3-Image is about 4 MP to 20 MP, and it generally gives
204
+ the best results at around 16 MP. Common 16 MP sizes are listed below:
205
+
206
+ | Aspect ratio | Size (width x height) |
207
+ | --- | --- |
208
+ | 1:1 | 4096x4096 |
209
+ | 4:3 / 3:4 | 4736x3552 / 3552x4736 |
210
+ | 3:2 / 2:3 | 5024x3360 / 3360x5024 |
211
+ | 16:9 / 9:16 | 5472x3072 / 3072x5472 |
212
+ | 21:9 | 6272x2688 |
213
+
214
+ ### Full Workflow
215
+
216
+ MiniMax-H3-Image expects a detailed English description of the whole image. The MiniMax API
217
+ turns a short prompt in any language into such a description with **H3-Image-Context-IR** before
218
+ generation. We also provide
219
+ [MiniMax-H3-Image-PE](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE), which can be
220
+ deployed locally.
221
+
222
+ This section reproduces the quality of images generated directly by the MiniMax API with a
223
+ locally deployed SGLang server. The scripts are in
224
+ [`examples/`](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/tree/main/examples) and use only
225
+ the Python standard library; run them in that folder:
226
+
227
+ ```bash
228
+ hf download MiniMaxAI/MiniMax-H3-Image --include "examples/*" --local-dir .
229
+ cd examples
230
+ ```
231
+
232
+ Before running examples, set your MiniMax API endpoint and key to use the H3-Image-Context-IR API
233
+ and the reference scripts. The scripts read them from the environment:
234
+
235
+ ```bash
236
+ # MiniMax API endpoint (choose one)
237
+ # CN
238
+ export MINIMAX_API_BASE="https://api.minimax.cn"
239
+ # Global
240
+ # export MINIMAX_API_BASE="https://api.minimax.io"
241
+
242
+ # API key obtained from the MiniMax platform
243
+ export MINIMAX_API_KEY="<api-key>"
244
+ ```
245
+
246
+ API docs:
247
+ - H3-Image-Context-IR: use /v1/h3_image_context_ir [EN-docs](https://platform.minimax.io/docs/api-reference/image-generation-h3-context-ir), [CN-docs](https://platform.minimax.cn/docs/api-reference/image-generation-h3-context-ir)
248
+ - Text-to-image: use /v1/images/generations [EN-docs](https://platform.minimax.io/docs/api-reference/image-generation-h3-generations), [CN-docs](https://platform.minimax.cn/docs/api-reference/image-generation-h3-generations)
249
+ - Image editing: use /v1/images/edits [EN-docs](https://platform.minimax.io/docs/api-reference/image-generation-h3-edits), [CN-docs](https://platform.minimax.cn/docs/api-reference/image-generation-h3-edits)
250
+
251
+ #### case-T2I
252
+
253
+ [`instruction.t2i.txt`](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/instruction.t2i.txt).
254
+
255
+ <table>
256
+ <thead>
257
+ <tr><th colspan="2">Stage</th><th>Request</th><th>Result</th></tr>
258
+ </thead>
259
+ <tbody>
260
+ <tr><td rowspan="2">Prompt Enhancement</td><td>H3-Image-Context-IR (MiniMax API)</td><td><code>python3 context_ir.py t2i</code> (<a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/context_ir.py">script</a>)</td><td><code>revised_prompt.txt</code>, <code>revised_size.txt</code>; our run: <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/revised_prompt.t2i.txt"><code>revised_prompt.t2i.txt</code></a>, <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/revised_size.t2i.txt"><code>revised_size.t2i.txt</code></a> (4736x3552)</td></tr>
261
+ <tr><td>local alternative: <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE">MiniMax-H3-Image-PE</a></td><td><code>scripts/expand_prompt.py</code> in the PE repository</td><td>Save <code>expanded_caption</code> as <code>revised_prompt.txt</code> and the size for <code>aspect_ratio</code> as <code>revised_size.txt</code></td></tr>
262
+ <tr><td colspan="2">MiniMax-H3-Image generation: local SGLang</td><td><code>python3 t2i.py --prompt revised_prompt.txt --size $(cat revised_size.txt)</code> (<a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/t2i.py">script</a>)</td><td><code>t2i.png</code></td></tr>
263
+ <tr><td colspan="2">E2E API Reference: text-to-image by directly calling the MiniMax API</td><td><code>python3 api_generate.py t2i</code> (<a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/api_generate.py">script</a>)</td><td><code>api_t2i.png</code></td></tr>
264
+ </tbody>
265
+ </table>
266
+
267
+ <p align="center">
268
+ <img src="assets/workflow_t2i.jpg" alt="Left: t2i.png from local SGLang with the enhanced prompt. Right: api_t2i.png from the MiniMax API. Both show an overhead farm-to-table feast with bread, vegetables and cheeses on a weathered wooden table" width="100%"/>
269
+ </p>
270
+ <p align="center"><em>t2i.png from local SGLang (left) and api_t2i.png from the MiniMax API (right), 4736x3552 (4:3 picked by H3-Image-Context-IR)</em></p>
271
+
272
+ #### case-Edit
273
+
274
+ [`instruction.edit.txt`](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/instruction.edit.txt)
275
+ with the reference image [`reference1.png`](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/reference1.png)
276
+ as `<Picture 1>`.
277
+
278
+ | Stage | Request | Result |
279
+ | --- | --- | --- |
280
+ | Prompt Enhancement: H3-Image-Context-IR (MiniMax API) | `python3 context_ir.py edit` ([script](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/context_ir.py)) | `revised_prompt.txt`, `revised_size.txt`; our run: [`revised_prompt.edit.txt`](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/revised_prompt.edit.txt), [`revised_size.edit.txt`](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/revised_size.edit.txt) (4096x4096) |
281
+ | MiniMax-H3-Image generation: local SGLang | `python3 edit.py --prompt revised_prompt.txt --size $(cat revised_size.txt)` ([script](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/edit.py)) | `edit.png` |
282
+ | E2E API Reference: image editing by directly calling the MiniMax API | `python3 api_generate.py edit` ([script](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/examples/api_generate.py)) | `api_edit.png` |
283
+
284
+ <p align="center">
285
+ <img src="assets/workflow_edit.jpg" alt="Left: reference1.png, the reference image of two podcast hosts with the man wearing headphones. Middle: edit.png from local SGLang with the enhanced prompt. Right: api_edit.png from the MiniMax API. In both results the headphones are gone and the hosts bump fists above the MONEY TALKS sign" width="100%"/>
286
+ </p>
287
+ <p align="center"><em>Reference image reference1.png (left), edit.png from local SGLang (middle) and api_edit.png from the MiniMax API (right), 4096x4096 (1:1 picked by H3-Image-Context-IR)</em></p>
288
+
289
+ ## Showcase
290
+
291
+ Text-to-image and image editing results, shown downscaled.
292
+
293
+ <p align="center">
294
+ <img src="assets/showcase/photo.jpg" alt="Three photorealistic photographs: a woman hanging white sheets on a rooftop at dusk under a full moon, a close-up profile of a curly-haired young man holding a cup, and flamingos wading in shallow water" width="100%"/>
295
+ </p>
296
+ <p align="center"><em>Photorealistic photography</em></p>
297
+
298
+ <p align="center">
299
+ <img src="assets/showcase/surreal.jpg" alt="Three surreal editorial photographs: a barber trimming a cloud seated in a barber chair, a person slicing the moon on a lawn at night, and a model stepping out of a giant pear" width="100%"/>
300
+ </p>
301
+ <p align="center"><em>Surreal editorial photography</em></p>
302
+
303
+ <p align="center">
304
+ <img src="assets/showcase/scene.jpg" alt="Four environment concepts: ruins of an ancient open-air theater in a forest titled ENVIRONMENT CONCEPT: THE ANCIENT THEATER, a dragon rider on a red rock cliff, an abandoned railway station with an ARRIVALS sign, and shipwrecks frozen in an icy sea" width="100%"/>
305
+ </p>
306
+ <p align="center"><em>Environment concepts</em></p>
307
+
308
+ <p align="center">
309
+ <img src="assets/showcase/char.jpg" alt="Characters, creatures and props: a soldier in a worn helmet and armor, a red-finned dragon-like creature in a forest, a weathered astronaut helmet on Mars, and a three-view character sheet of a figure in winter clothing" width="100%"/>
310
+ </p>
311
+ <p align="center"><em>Characters, creatures and props</em></p>
312
+
313
+ <p align="center">
314
+ <img src="assets/showcase/art.jpg" alt="Four paintings and illustrations: mandarin ducks in a lotus pond in an oil painting style, a Jiangnan garden in light watercolor, tarot card XVIII THE MOON with a rabbit, and a Chinese gongbi painting of a pelican looking into a mirror with four calligraphy characters" width="100%"/>
315
+ </p>
316
+ <p align="center"><em>Painting and illustration styles</em></p>
317
+
318
+ <p align="center">
319
+ <img src="assets/showcase/text.jpg" alt="Two logic puzzle boards: a Chinese candidate-selection puzzle with five conditions and the derived answer, and an English board titled CONFIDENTIAL FILE MISSING with six suspects, true/false stamps and a verification table" width="100%"/>
320
+ </p>
321
+ <p align="center"><em>Text rendering with reasoning: logic puzzles in Chinese and English, solved correctly on the board</em></p>
322
+
323
+ <p align="center">
324
+ <img src="assets/showcase/edit_render.jpg" alt="Left: untextured grey 3D render of a lunar base with habitat modules, a rover and an astronaut. Right: the same scene as a photorealistic film still on the lunar surface" width="100%"/>
325
+ </p>
326
+ <p align="center"><em>Image editing, one reference: an untextured 3D render (left) turned into a film still of a lunar research base (right)</em></p>
327
+
328
+ <p align="center">
329
+ <img src="assets/showcase/edit_map.jpg" alt="Left: illustrated game map with a river, a waterfall, bridges, a castle, a village, a mine and a harbor, and a red arrow on the southern lake. Right: first-person 3D game view from the lake towards the waterfall, the suspension bridge, the mine and the distant castle, with the map as a minimap in the top-left corner" width="100%"/>
330
+ </p>
331
+ <p align="center"><em>Image editing, one reference: a game map (left) turned into a first-person 3D game view from the red arrow's position, with the map as a minimap (right)</em></p>
332
+
333
+ <p align="center">
334
+ <img src="assets/showcase/edit_multi.jpg" alt="Top: ten reference images, an empty sunlit room and nine pieces of furniture. Bottom: the empty room furnished with all nine pieces as a living room" width="100%"/>
335
+ </p>
336
+ <p align="center"><em>Image editing, ten references: an empty room and nine pieces of furniture (top) composed into one living room (bottom)</em></p>
337
+
338
+ ## License
339
+
340
+ - MiniMax-H3-Image is released under the [MiniMax-H3-Image Community License Agreement](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE).
341
+ - The T2I PE Model ([MiniMax-H3-Image-PE](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE)) is part of MiniMax-H3-Image and is accordingly subject to [MiniMax-H3-Image Community License Agreement](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE).
342
+ - The separate written authorization described in Section IV of the license is requested through [platform.minimax.io/license](https://platform.minimax.io/license).
343
+ - [Application form](https://platform.minimax.io/console/license)
344
+
345
+ ## Contact Us
346
+
347
+ Contact us at [model@minimax.io](mailto:model@minimax.io).
assets/minimax-h3-image.jpg ADDED

Git LFS Details

  • SHA256: 5e007e09a3b4c943628b78db63646b1a1c515f363733efd0260bafa200311211
  • Pointer size: 131 Bytes
  • Size of remote file: 604 kB
assets/showcase/art.jpg ADDED

Git LFS Details

  • SHA256: c82d3598b38b600c0463654da88dff651f6e728130d81c94a3ba8c51134ed50b
  • Pointer size: 131 Bytes
  • Size of remote file: 986 kB
assets/showcase/char.jpg ADDED

Git LFS Details

  • SHA256: 43071bb73a98657dd541aa9ce6ca0da01743c33dc93beaea443ea59efa7cee3d
  • Pointer size: 131 Bytes
  • Size of remote file: 437 kB
assets/showcase/edit_map.jpg ADDED

Git LFS Details

  • SHA256: f915c291bfa6b80aa34204ff14ad3ed447e3c8a4aec9240ddb300676030f1260
  • Pointer size: 132 Bytes
  • Size of remote file: 1.12 MB
assets/showcase/edit_multi.jpg ADDED

Git LFS Details

  • SHA256: 0fb39644b7945ecee27d0543403a75878dddf00c5c60e5d400aeaf5970a40be5
  • Pointer size: 131 Bytes
  • Size of remote file: 809 kB
assets/showcase/edit_render.jpg ADDED

Git LFS Details

  • SHA256: 60dd5476d2567cbc0e2a9de3de0f8552352dcb8d92c0d5692051da7faaea9d62
  • Pointer size: 131 Bytes
  • Size of remote file: 570 kB
assets/showcase/photo.jpg ADDED

Git LFS Details

  • SHA256: f46d75cf8e301e47631885a3cfe5ecd584e17b7d5a48dcc8c06aac2414ef37e8
  • Pointer size: 131 Bytes
  • Size of remote file: 243 kB
assets/showcase/scene.jpg ADDED

Git LFS Details

  • SHA256: 100511a798fdc7f1e642dfc10e412bd66481999e0430dacfcc2f1317379d9840
  • Pointer size: 132 Bytes
  • Size of remote file: 1.39 MB
assets/showcase/surreal.jpg ADDED

Git LFS Details

  • SHA256: 3c05b55223cbdcb33c8011deb8ccda6de1b4c5ca0bbcc92bd2134c5f2e69eaba
  • Pointer size: 131 Bytes
  • Size of remote file: 368 kB
assets/showcase/text.jpg ADDED

Git LFS Details

  • SHA256: 21cb8f0b7af3a64b9a2ba9bb29d0ace53d6e96cdcecfc50ab084088335016b55
  • Pointer size: 131 Bytes
  • Size of remote file: 545 kB
assets/showcase_hero.jpg ADDED

Git LFS Details

  • SHA256: fbcb0a3292548856d4906dfd7b22a7608da8d118357ae07ae417a9931dfcc8c7
  • Pointer size: 132 Bytes
  • Size of remote file: 1.26 MB
assets/workflow_edit.jpg ADDED

Git LFS Details

  • SHA256: 32555ea21e53cd3d7a47f9b0a6dba66d626a98f40339529d0d2c503a9cbc1f40
  • Pointer size: 131 Bytes
  • Size of remote file: 608 kB
assets/workflow_t2i.jpg ADDED

Git LFS Details

  • SHA256: 7c74a3b8ae85e3bfbf78e9cbc91c76e9fa044a4fee81e4d100b019710ebbfdf0
  • Pointer size: 132 Bytes
  • Size of remote file: 1.37 MB
examples/api_generate.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Generate the same image with the MiniMax API, as a reference for the local result.
3
+
4
+ export MINIMAX_API_BASE=https://api.minimax.cn # CN; Global: https://api.minimax.io
5
+ export MINIMAX_API_KEY=<API key>
6
+ python3 api_generate.py t2i # POST /v1/images/generations with instruction.t2i.txt
7
+ python3 api_generate.py edit # POST /v1/images/edits with instruction.edit.txt and reference1.png
8
+
9
+ The API applies the same prompt enhancement internally. Writes the image (api_<task>.png) and
10
+ the prompt the API used (api_<task>_revised_prompt.txt). Uses only the Python standard library.
11
+ """
12
+
13
+ import argparse
14
+ import base64
15
+ import json
16
+ from pathlib import Path
17
+
18
+ from context_ir import HERE, add_task_arguments, post, request_body
19
+
20
+
21
+ def main() -> None:
22
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
23
+ add_task_arguments(parser)
24
+ args = parser.parse_args()
25
+
26
+ instruction = args.instruction or HERE / f"instruction.{args.task}.txt"
27
+ body = request_body(args.task, instruction, args.image, args.size)
28
+ body.update({"n": 1, "response_format": "b64_json", "output_format": "png"})
29
+ path = "/v1/images/generations" if args.task == "t2i" else "/v1/images/edits"
30
+ result = post(path, body)
31
+ item = result["data"][0]
32
+ if "error" in item:
33
+ raise RuntimeError(f"image failed: {item['error']} (request_id {result.get('request_id')})")
34
+ Path(f"api_{args.task}.png").write_bytes(base64.b64decode(item["b64_json"]))
35
+ Path(f"api_{args.task}_revised_prompt.txt").write_text(item["revised_prompt"])
36
+ print(json.dumps({"request_id": result.get("request_id"), "size": item.get("size"), "usage": result.get("usage")}))
37
+
38
+
39
+ if __name__ == "__main__":
40
+ main()
examples/context_ir.py ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Enhance a prompt with the MiniMax H3-Image-Context-IR API.
3
+
4
+ export MINIMAX_API_BASE=https://api.minimax.cn # CN; Global: https://api.minimax.io
5
+ export MINIMAX_API_KEY=<API key>
6
+ python3 context_ir.py t2i # instruction.t2i.txt
7
+ python3 context_ir.py edit # instruction.edit.txt with reference1.png
8
+
9
+ Sends the instruction (and, for edit, the reference images) to POST /v1/h3_image_context_ir
10
+ and writes the enhanced prompt to revised_prompt.txt. Unless --size is given, the API also
11
+ picks the aspect ratio; the matching size of about 16 megapixels is written to
12
+ revised_size.txt. Pass the files to t2i.py / edit.py with --prompt and --size. Uses only the
13
+ Python standard library.
14
+ """
15
+
16
+ import argparse
17
+ import base64
18
+ import json
19
+ import math
20
+ import mimetypes
21
+ import os
22
+ import urllib.request
23
+ from pathlib import Path
24
+
25
+ # absolute(), not resolve(): in the Hugging Face cache this file is a symlink into blobs/.
26
+ HERE = Path(__file__).absolute().parent
27
+ AREA = 4096 * 4096
28
+
29
+
30
+ def data_uri(path: Path) -> str:
31
+ content_type = mimetypes.guess_type(path.name)[0]
32
+ if content_type is None:
33
+ raise ValueError(f"unknown image type: {path}")
34
+ return f"data:{content_type};base64,{base64.b64encode(path.read_bytes()).decode()}"
35
+
36
+
37
+ def size_for(aspect_ratio: str) -> str:
38
+ """About 16 megapixels at the ratio, both sides multiples of 32 (matches the README Sizes table)."""
39
+ x, y = (int(v) for v in aspect_ratio.split(":"))
40
+ width = round(math.sqrt(AREA * x / y) / 32) * 32
41
+ height = round(math.sqrt(AREA * y / x) / 32) * 32
42
+ return f"{width}x{height}"
43
+
44
+
45
+ def post(path: str, body: dict) -> dict:
46
+ request = urllib.request.Request(
47
+ f"{os.environ['MINIMAX_API_BASE'].rstrip('/')}{path}",
48
+ data=json.dumps(body).encode(),
49
+ headers={"Authorization": f"Bearer {os.environ['MINIMAX_API_KEY']}", "Content-Type": "application/json"},
50
+ )
51
+ with urllib.request.urlopen(request, timeout=600) as response:
52
+ return json.load(response)
53
+
54
+
55
+ def request_body(task: str, instruction: Path, images: list, size) -> dict:
56
+ body = {"model": "MiniMax-H3-Image", "prompt": instruction.read_text().strip()}
57
+ if task == "edit":
58
+ body["images"] = [{"image_url": data_uri(path)} for path in images or [HERE / "reference1.png"]]
59
+ if size:
60
+ body["size"] = size
61
+ return body
62
+
63
+
64
+ def add_task_arguments(parser: argparse.ArgumentParser) -> None:
65
+ parser.add_argument("task", choices=["t2i", "edit"])
66
+ parser.add_argument("--instruction", type=Path, help="default: instruction.<task>.txt")
67
+ parser.add_argument("--image", action="append", type=Path,
68
+ help="edit only: reference image; repeat for <Picture 2>, ... (default: reference1.png)")
69
+ parser.add_argument("--size", help="WIDTHxHEIGHT of the image you will generate (default: chosen by the API)")
70
+
71
+
72
+ def main() -> None:
73
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
74
+ add_task_arguments(parser)
75
+ parser.add_argument("--out", default="revised_prompt.txt")
76
+ parser.add_argument("--size-out", default="revised_size.txt", help="written when the API picks the aspect ratio")
77
+ args = parser.parse_args()
78
+
79
+ instruction = args.instruction or HERE / f"instruction.{args.task}.txt"
80
+ result = post("/v1/h3_image_context_ir", request_body(args.task, instruction, args.image, args.size))
81
+ Path(args.out).write_text(result["revised_prompt"])
82
+ summary = {"request_id": result.get("request_id"), "usage": result.get("usage")}
83
+ if "aspect_ratio" in result:
84
+ summary["aspect_ratio"] = result["aspect_ratio"]
85
+ summary["size"] = size_for(result["aspect_ratio"])
86
+ Path(args.size_out).write_text(summary["size"])
87
+ print(json.dumps(summary))
88
+
89
+
90
+ if __name__ == "__main__":
91
+ main()
examples/edit.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Send reference1.png and prompt.edit.txt to a MiniMax-H3-Image server and write the PNG.
3
+
4
+ python3 edit.py [--url http://127.0.0.1:30000] [--out edit.png]
5
+
6
+ The images are sent in --image order, which defines <Picture 1>, <Picture 2>, ... in the
7
+ prompt. Uses only the Python standard library.
8
+ """
9
+
10
+ import argparse
11
+ import base64
12
+ import json
13
+ import mimetypes
14
+ import urllib.request
15
+ import uuid
16
+ from pathlib import Path
17
+
18
+ # absolute(), not resolve(): in the Hugging Face cache this file is a symlink into blobs/.
19
+ HERE = Path(__file__).absolute().parent
20
+
21
+
22
+ def multipart(fields: dict, images: list) -> tuple:
23
+ boundary = f"minimax-h3-image-{uuid.uuid4().hex}"
24
+ parts = []
25
+ for name, value in fields.items():
26
+ parts.append(f'--{boundary}\r\nContent-Disposition: form-data; name="{name}"\r\n\r\n{value}\r\n'.encode())
27
+ for path in images:
28
+ content_type = mimetypes.guess_type(path.name)[0] or "application/octet-stream"
29
+ parts.append(
30
+ f'--{boundary}\r\nContent-Disposition: form-data; name="image"; filename="{path.name}"\r\n'
31
+ f"Content-Type: {content_type}\r\n\r\n".encode()
32
+ )
33
+ parts.append(path.read_bytes() + b"\r\n")
34
+ parts.append(f"--{boundary}--\r\n".encode())
35
+ return b"".join(parts), f"multipart/form-data; boundary={boundary}"
36
+
37
+
38
+ def main() -> None:
39
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
40
+ parser.add_argument("--url", default="http://127.0.0.1:30000", help="server base URL")
41
+ parser.add_argument("--image", action="append", type=Path,
42
+ help="reference image; repeat for <Picture 2>, ... (default: reference1.png)")
43
+ parser.add_argument("--prompt", type=Path, default=HERE / "prompt.edit.txt", help="prompt file")
44
+ parser.add_argument("--size", default="4096x4096", help="WIDTHxHEIGHT")
45
+ parser.add_argument("--seed", type=int, default=1234)
46
+ parser.add_argument("--out", default="edit.png")
47
+ args = parser.parse_args()
48
+
49
+ fields = {
50
+ "prompt": args.prompt.read_text(),
51
+ "size": args.size,
52
+ "seed": str(args.seed),
53
+ "generator_device": "cpu",
54
+ "response_format": "b64_json",
55
+ "output_format": "png",
56
+ }
57
+ body, content_type = multipart(fields, args.image or [HERE / "reference1.png"])
58
+ request = urllib.request.Request(
59
+ f"{args.url.rstrip('/')}/v1/images/edits", data=body, headers={"Content-Type": content_type}
60
+ )
61
+ with urllib.request.urlopen(request, timeout=1800) as response:
62
+ payload = json.load(response)
63
+ with open(args.out, "wb") as image:
64
+ image.write(base64.b64decode(payload["data"][0]["b64_json"]))
65
+ print(f"wrote {args.out}")
66
+
67
+
68
+ if __name__ == "__main__":
69
+ main()
examples/instruction.edit.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Take the over-ear headphones off the man on the left and fill in his hair where the band flattened it. Have both hosts lean toward each other and fist-bump directly above the "MONEY TALKS" desk sign, knuckles touching, elbows lifted off the desk, so the bump sits dead centre between the two microphones.
examples/instruction.t2i.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ A rustic, overhead shot of a farm-to-table feast, showcasing a variety of colorful, seasonal vegetables, artisanal cheeses, and freshly baked bread on a weathered wooden table.
examples/prompt.edit.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ The dark, warmly lit podcast studio photograph of two hosts behind a wooden desk in <Picture 1> is <Subject 1>. <Subject 1> is mostly preserved: the large "EP. 47" title in the top right corner, the dark textured wall, the wooden shelves with plants, a brass globe, a lit candle, books and the "DISCIPLINE > MOTIVATION" chalkboard, the framed "COMPOUND CONSISTENCY CONFIDENCE" poster, the glowing floor lamp on the left and the table lamp on the right, the two black microphones on their stands, the black "INVEST IN YOURSELF" and "PLAN BUILD WEALTH" mugs, the carved wooden "MONEY TALKS" desk sign, the dark wooden desk, both hosts' faces, smiles and clothing, the man's wristwatch and the woman's hoop earrings all stay exactly the same. Only the headphones and the hosts' poses change. The over-ear headphones and their cable are removed from the man on the left, and his short, tousled dark brown curly hair is filled in naturally over the top and sides of his head where the headband had flattened it, leaving no dent or mark. The two hosts lean toward each other and bump fists directly above the "MONEY TALKS" sign: one fist from each host meets with the knuckles touching, both elbows lifted off the desk, so the fist bump sits exactly at the horizontal centre of the frame, midway between the two microphones. The target image is a square, cinematic photograph of the podcast set: the man in the black crew-neck sweater on the left and the woman with long wavy brown hair in the cream knit sweater on the right lean in and smile at each other, their forearms raised so the touching fists hover just above the top edge of the "MONEY TALKS" sign between the two microphones, while the warm lamp light, the dark shelves behind them and the "EP. 47" title in the top right keep the original moody lighting and colors.
examples/reference1.png ADDED

Git LFS Details

  • SHA256: e3ef31ce2bf5f9a6f45c13f65b4728a87cc767cbcc8f0313aa1a4c8014dae85d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.72 MB
examples/request.t2i.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "prompt": "The image is a photorealistic overhead food photograph capturing a rustic farm-to-table feast spread across a heavily weathered, dark brown wooden table with deep visible grain and scratches. The composition is a top-down view looking directly at the table surface. In the center sits a large woven jute placemat supporting a freshly baked rustic sourdough loaf with a deeply scored, golden-brown crust and a dusting of flour. To the upper left, a hammered copper bowl overflows with a colorful mix of fresh seasonal vegetables, including purple kale, bright orange carrots, red beets, and vibrant green salad leaves. In the upper right, a dark wooden cheese board holds neatly arranged artisanal cheeses: a wedge of bloomy rind brie with a creamy yellow interior, a wedge of aged cheddar with a golden rind, and a log of goat cheese sprinkled with cracked peppercorns and rosemary sprigs. The lower left contains a cluster of heirloom tomatoes, small cherry tomatoes on the vine, scattered toasted walnuts, and a small ceramic bowl of green olives. In the lower right, a clear glass wine glass filled with dark red wine sits beside a vintage brass candle holder with a lit white taper candle. A smaller wooden cutting board holding sliced apples and a wedge of brie overlaps the center of the table. The warm natural sunlight originates from the left, creating a realistic interplay of dappled shadows, crisp highlights on the polished glass and glossy tomatoes, and rich drop shadows that emphasize the rough wood grain and textured vegetables.",
3
+ "size": "4736x3552",
4
+ "seed": 42,
5
+ "generator_device": "cpu",
6
+ "response_format": "b64_json",
7
+ "output_format": "png"
8
+ }
examples/revised_prompt.edit.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ The man on the left in a dark sweater and wristwatch in <Picture 1> is <Subject 1>. The woman on the right in a beige sweater and hoop earrings in <Picture 1> is <Subject 2>. The pair of black microphones on stands in front of the hosts in <Picture 1> is <Subject 3>. The wooden desk sign with raised lettering reading 'MONEY TALKS' in <Picture 1> is <Subject 4>. The black mug on the left with text reading 'INVEST', 'IN', and 'YOURSELF' on three lines in <Picture 1> is <Subject 5>. The black mug on the right with text reading 'PLAN', 'BUILD', and 'WEALTH' on three lines in <Picture 1> is <Subject 6>. The upper-right overlay text reading 'EP. 47' in <Picture 1> is <Subject 7>. The framed wall poster on the right reading 'COMPOUND', 'CONSISTENCY', and 'CONFIDENCE' on three lines in <Picture 1> is <Subject 8>. The small framed shelf sign in the center background reading 'DISCIPLINE', '>', and 'MOTIVATION' on three lines in <Picture 1> is <Subject 9>. The podcast studio environment, including the wooden desk, shelves, lamps, books, and decor in <Picture 1>, is <Subject 10>. The target image shows <Subject 1> without the over-ear headphones from <Picture 1> and with fuller hair, as <Subject 1> and <Subject 2> lean inward to fist-bump directly above <Subject 4> between <Subject 3>. <Subject 1> is partially preserved; his identity, facial features, expression, dark sweater, and wristwatch remain, while his headphones are removed, his crown hair is filled in, and his posture changes from resting his forearms on the desk to leaning toward <Subject 2> with lifted elbows for a central fist-bump. <Subject 2> is partially preserved; her identity, facial features, expression, hair, earrings, and beige sweater remain, while her posture changes from crossed arms on the desk to leaning toward <Subject 1> with lifted elbows for a central fist-bump. <Subject 3> is fully preserved. <Subject 4> is fully preserved. <Subject 5> is fully preserved. <Subject 6> is fully preserved. <Subject 7> is fully preserved. <Subject 8> is fully preserved. <Subject 9> is fully preserved. <Subject 10> is fully preserved. On <Subject 1>, the headband indentation across the top of his head is gone, replaced by natural, voluminous wavy brown curls that match the texture and warm highlights of his existing hair, leaving his ears and temples completely uncovered where the earcups and cords used to be. Both <Subject 1> and <Subject 2> angle their torsos slightly inward toward the center of the frame. Their elbows are raised clear off the desk surface, bringing their inner forearms up into the space behind <Subject 3> and directly above <Subject 4>. Their hands are clenched into fists with knuckles touching dead center between the two microphones of <Subject 3>, casting soft contact shadows onto each other's knuckles and subtle warm light reflections from the studio lamps across their sleeves and raised arms.
examples/revised_prompt.t2i.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ The image is an overhead, top-down photograph of a rustic farm-to-table feast spread across a weathered, dark brown wooden table with visible grain, knots, and a worn finish. In the center, a large woven basket holds a freshly baked rustic loaf of bread with a cracked golden-brown crust and scattered flour, alongside a halved loaf. To the left, a large dark ceramic plate presents an assortment of colorful seasonal vegetables, including bright orange carrots, deep red heirloom tomatoes, purple cabbage, and a mound of vibrant green leafy kale and arugula. On the right side, a wooden board displays artisanal cheeses: a wedge of sharp aged cheddar, a round of creamy brie with a rind, a soft blue cheese, and a few scattered almonds and walnuts. Below the bread in the lower center, a shallow bowl contains roasted root vegetables, including golden potatoes and beets, sprinkled with fresh rosemary sprigs. At the upper right, a glass jar of golden olive oil stands beside a smaller jar of honey with a wooden dipper. In the lower left, a rustic cloth napkin holds a silver knife and fork. At the upper left, a bunch of purple and red grapes rests near a small bowl of black olives. Scattered herbs, including fresh thyme and sprigs of oregano, decorate the table. The lighting is natural and warm, coming from the upper left and casting soft, long shadows to the lower right, enhancing the texture of the bread, the moisture of the vegetables, and the overall cozy, bountiful atmosphere of the meal.
examples/revised_size.edit.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 4096x4096
examples/revised_size.t2i.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ 4736x3552
examples/t2i.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Send request.t2i.json to a MiniMax-H3-Image server and write the PNG.
3
+
4
+ python3 t2i.py [--url http://127.0.0.1:30000] [--prompt FILE] [--size WxH] [--out t2i.png]
5
+
6
+ --prompt and --size replace the prompt and the size in the request.
7
+
8
+ Uses only the Python standard library.
9
+ """
10
+
11
+ import argparse
12
+ import base64
13
+ import json
14
+ import urllib.request
15
+ from pathlib import Path
16
+
17
+ # absolute(), not resolve(): in the Hugging Face cache this file is a symlink into blobs/.
18
+ HERE = Path(__file__).absolute().parent
19
+
20
+
21
+ def main() -> None:
22
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
23
+ parser.add_argument("--url", default="http://127.0.0.1:30000", help="server base URL")
24
+ parser.add_argument("--request", type=Path, default=HERE / "request.t2i.json", help="JSON request body")
25
+ parser.add_argument("--prompt", type=Path, help="prompt file; replaces the prompt in the request")
26
+ parser.add_argument("--size", help="WIDTHxHEIGHT; replaces the size in the request")
27
+ parser.add_argument("--out", default="t2i.png")
28
+ args = parser.parse_args()
29
+
30
+ body = json.loads(args.request.read_text())
31
+ if args.prompt:
32
+ body["prompt"] = args.prompt.read_text()
33
+ if args.size:
34
+ body["size"] = args.size
35
+
36
+ request = urllib.request.Request(
37
+ f"{args.url.rstrip('/')}/v1/images/generations",
38
+ data=json.dumps(body).encode(),
39
+ headers={"Content-Type": "application/json"},
40
+ )
41
+ with urllib.request.urlopen(request, timeout=1800) as response:
42
+ payload = json.load(response)
43
+ with open(args.out, "wb") as image:
44
+ image.write(base64.b64decode(payload["data"][0]["b64_json"]))
45
+ print(f"wrote {args.out}")
46
+
47
+
48
+ if __name__ == "__main__":
49
+ main()
model_index.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3ImagePipeline",
3
+ "_diffusers_version": "0.37.0",
4
+ "_minimax_h3": {
5
+ "partition": "image",
6
+ "pdd_fused_heads": "pdd_fused_heads.safetensors",
7
+ "schema_version": 1,
8
+ "task_aliases": {},
9
+ "tasks": [
10
+ "t2i",
11
+ "edit"
12
+ ]
13
+ },
14
+ "processor": [
15
+ "transformers",
16
+ "Qwen3VLProcessor"
17
+ ],
18
+ "scheduler": null,
19
+ "text_encoder": [
20
+ "transformers",
21
+ "Qwen3VLForConditionalGeneration",
22
+ {
23
+ "type_hint": [
24
+ "transformers",
25
+ "Qwen3VLForConditionalGeneration"
26
+ ],
27
+ "pretrained_model_name_or_path": "MiniMaxAI/MiniMax-H3",
28
+ "subfolder": "text_encoder",
29
+ "variant": null,
30
+ "revision": null
31
+ }
32
+ ],
33
+ "tokenizer": [
34
+ "transformers",
35
+ "Qwen2TokenizerFast"
36
+ ],
37
+ "transformer": [
38
+ "diffusers",
39
+ "MiniMaxH3DiTModel"
40
+ ],
41
+ "vae": [
42
+ "diffusers",
43
+ "MiniMaxH3ImageVAE"
44
+ ]
45
+ }
pdd_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "num_inference_steps": 6,
3
+ "sigmas": [
4
+ 1.0,
5
+ 0.9675236940383911,
6
+ 0.8875485062599182,
7
+ 0.75,
8
+ 0.5327739119529724,
9
+ 0.23200887441635132,
10
+ 0.0
11
+ ]
12
+ }
pdd_fused_heads.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c07093a098e3bef4d43cd29c33e239a0c45424c5ff40dfcc864df00b8d664738
3
+ size 12388808
processor/chat_template.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- for message in messages %}\n {%- if message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content_item in message.content %}\n {%- if 'text' in content_item %}\n {{- content_item.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and message.content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n"
3
+ }
processor/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
processor/preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 16777216,
4
+ "shortest_edge": 65536
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "image_processor_type": "Qwen2VLImageProcessorFast"
21
+ }
processor/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
processor/tokenizer_config.json ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ }
213
+ },
214
+ "additional_special_tokens": [
215
+ "<|im_start|>",
216
+ "<|im_end|>",
217
+ "<|object_ref_start|>",
218
+ "<|object_ref_end|>",
219
+ "<|box_start|>",
220
+ "<|box_end|>",
221
+ "<|quad_start|>",
222
+ "<|quad_end|>",
223
+ "<|vision_start|>",
224
+ "<|vision_end|>",
225
+ "<|vision_pad|>",
226
+ "<|image_pad|>",
227
+ "<|video_pad|>",
228
+ "<d>",
229
+ "</d>",
230
+ "<|cutoff|>",
231
+ "<|lyrics_start|>",
232
+ "<|lyrics_end|>",
233
+ "<|caption_start|>",
234
+ "<|caption_end|>"
235
+ ],
236
+ "bos_token": null,
237
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- for message in messages %}\n {%- if message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content_item in message.content %}\n {%- if 'text' in content_item %}\n {{- content_item.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and message.content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
238
+ "clean_up_tokenization_spaces": false,
239
+ "eos_token": "<|im_end|>",
240
+ "errors": "replace",
241
+ "model_max_length": 262144,
242
+ "pad_token": "<|endoftext|>",
243
+ "split_special_tokens": false,
244
+ "tokenizer_class": "Qwen2Tokenizer",
245
+ "unk_token": null
246
+ }
processor/video_preprocessor_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "size": {
3
+ "longest_edge": 25165824,
4
+ "shortest_edge": 4096
5
+ },
6
+ "patch_size": 16,
7
+ "temporal_patch_size": 2,
8
+ "merge_size": 2,
9
+ "image_mean": [
10
+ 0.5,
11
+ 0.5,
12
+ 0.5
13
+ ],
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "processor_class": "Qwen3VLProcessor",
20
+ "video_processor_type": "Qwen3VLVideoProcessor"
21
+ }
processor/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ }
213
+ },
214
+ "additional_special_tokens": [
215
+ "<|im_start|>",
216
+ "<|im_end|>",
217
+ "<|object_ref_start|>",
218
+ "<|object_ref_end|>",
219
+ "<|box_start|>",
220
+ "<|box_end|>",
221
+ "<|quad_start|>",
222
+ "<|quad_end|>",
223
+ "<|vision_start|>",
224
+ "<|vision_end|>",
225
+ "<|vision_pad|>",
226
+ "<|image_pad|>",
227
+ "<|video_pad|>",
228
+ "<d>",
229
+ "</d>",
230
+ "<|cutoff|>",
231
+ "<|lyrics_start|>",
232
+ "<|lyrics_end|>",
233
+ "<|caption_start|>",
234
+ "<|caption_end|>"
235
+ ],
236
+ "bos_token": null,
237
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].content is string %}\n {{- messages[0].content }}\n {%- else %}\n {%- for content in messages[0].content %}\n {%- if 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- for message in messages %}\n {%- if message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role + '\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content_item in message.content %}\n {%- if 'text' in content_item %}\n {{- content_item.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and message.content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {%- if message.content is string %}\n {{- message.content }}\n {%- else %}\n {%- for content in message.content %}\n {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}\n <|vision_start|><|image_pad|><|vision_end|>\n {%- elif content.type == 'video' or 'video' in content %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}\n <|vision_start|><|video_pad|><|vision_end|>\n {%- elif 'text' in content %}\n {{- content.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n",
238
+ "clean_up_tokenization_spaces": false,
239
+ "eos_token": "<|im_end|>",
240
+ "errors": "replace",
241
+ "model_max_length": 262144,
242
+ "pad_token": "<|endoftext|>",
243
+ "split_special_tokens": false,
244
+ "tokenizer_class": "Qwen2Tokenizer",
245
+ "unk_token": null
246
+ }
tokenizer/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
transformer/config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3DiTModel",
3
+ "_diffusers_version": "0.32.2",
4
+ "hidden_size": 5376,
5
+ "num_layers": 50,
6
+ "token_refiner_num_layers": 2,
7
+ "num_attention_heads": 56,
8
+ "attention_head_dim": 128,
9
+ "ffn_hidden_size": 14336,
10
+ "latents_dim": 24,
11
+ "audio_latents_dim": 32,
12
+ "patch_size": [
13
+ 1,
14
+ 2,
15
+ 2
16
+ ],
17
+ "text_dim": 5120,
18
+ "timestep_input_dim": 256,
19
+ "time_embed_hidden_size": 5376,
20
+ "time_embed_dim": 2688,
21
+ "adaln_out_features": 96768,
22
+ "final_adaln_out_features": 10752,
23
+ "rope_inv_freq_len": 16,
24
+ "norm_eps": 1e-05,
25
+ "qk_norm_eps": 1e-05,
26
+ "final_norm_eps": 1e-05,
27
+ "audio_enabled": false
28
+ }
transformer/model-00001-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:200667b632a6004bb8442008c4a8e975d64a7dbbc3d5569ed482650c3d61ff7b
3
+ size 5441123104
transformer/model-00002-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2227018562b2d92db391bce2fe641ea7f887585b581d6a73092a8fcfc59ef348
3
+ size 5839159856
transformer/model-00003-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:165469f7dccbb9fb6cbdc7a88e89d2a0220697af4da7ee40a96b369ccfa5abc9
3
+ size 5472861152
transformer/model-00004-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bf7dff80d49203cee29834ce6bd86077b09c4b73174d1c4f696f8fecab83ed3
3
+ size 5472860360
transformer/model-00005-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dcc7c79d46fa1ca910396fa001657985057db491af1bfadeda4cf3a82da329f2
3
+ size 5839159904
transformer/model-00006-of-00012.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12c76e39604f04d11d282172719bad6ad374e98479b8892f4ea0c9d2695b3086
3
+ size 5472861168