Buckets:

hf-doc-build/doc / diffusers /main /ar /api /pipelines /minimax_h3_image.html
mishig's picture
download
raw
45.3 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;MiniMax-H3-Image&quot;,&quot;local&quot;:&quot;minimax-h3-image&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;المكوّنات&quot;,&quot;local&quot;:&quot;components&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;سير العمل&quot;,&quot;local&quot;:&quot;workflows&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;تحسين الأوامر&quot;,&quot;local&quot;:&quot;prompt-enhancement&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;حجم الصورة&quot;,&quot;local&quot;:&quot;image-size&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;العينة&quot;,&quot;local&quot;:&quot;sampling&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;MiniMaxH3ImageModularPipeline&quot;,&quot;local&quot;:&quot;diffusers.MiniMaxH3ImageModularPipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;MiniMaxH3ImageBlocks&quot;,&quot;local&quot;:&quot;diffusers.MiniMaxH3ImageBlocks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/>
<link href="/docs/diffusers/main/en/_app/immutable/entry/start.U6TUchwJ.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/yxSHiGDF.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/CPfOwUO_.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/entry/app.3qKhPoX-.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/BYe-f74j.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DnVIJfC5.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/DsnmJJEf.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/D32hXVzh.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/0.DqpuBF3n.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/Dyp9xKq8.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/nodes/9.BHf5c0WW.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/Dk44y1gU.js" rel="modulepreload">
<link href="/docs/diffusers/main/en/_app/immutable/chunks/C4N0BX8L.js" rel="modulepreload">
<!--mp1ecb--><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;MiniMax-H3-Image&quot;,&quot;local&quot;:&quot;minimax-h3-image&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;Components&quot;,&quot;local&quot;:&quot;components&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Workflows&quot;,&quot;local&quot;:&quot;workflows&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Prompt enhancement&quot;,&quot;local&quot;:&quot;prompt-enhancement&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Image size&quot;,&quot;local&quot;:&quot;image-size&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;Sampling&quot;,&quot;local&quot;:&quot;sampling&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;MiniMaxH3ImageModularPipeline&quot;,&quot;local&quot;:&quot;diffusers.MiniMaxH3ImageModularPipeline&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;MiniMaxH3ImageBlocks&quot;,&quot;local&quot;:&quot;diffusers.MiniMaxH3ImageBlocks&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"/><!---->
<link href="/docs/diffusers/main/en/_app/immutable/assets/0.tn0RQdqM.css" rel="modulepreload"> <!--[--><!--[0--><!--[--><!--[0--><!--[--><p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: inline-end; margin-inline-start: 10px; display: inline-flex; position: relative; z-index: 10;"><div dir="ltr" class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----></span> <span dir="auto">Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg><!----></button></div> <!--[-1--><!--]--></div><!----> <!--[0--><h1 class="relative group"><a id="minimax-h3-image" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#minimax-h3-image"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->MiniMax-H3-Image<!----></span></h1><!--]--><!----> <p>MiniMax-H3-Image هو نموذج صور من MiniMax مبني على <a href="./minimax_h3">MiniMax-H3</a>، مخصص لتوليد الصور من النص وتحرير الصور المرجعية. يمكنك العثور على نقطة التفتيش في <a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image" rel="nofollow">MiniMaxAI/MiniMax-H3-Image</a>.</p> <p>على غرار MiniMax-H3، يتم دمجه على شكل كتل <a href="../../modular_diffusers/overview">Modular Diffusers</a> فقط: فـ <a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3_image#diffusers.MiniMaxH3ImageBlocks">MiniMaxH3ImageBlocks</a> وخط أنابيبها <a href="/docs/diffusers/main/ar/api/pipelines/minimax_h3_image#diffusers.MiniMaxH3ImageModularPipeline">MiniMaxH3ImageModularPipeline</a> هما كل ما يتألف منه الدمج.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ComponentsManager, ModularPipeline
manager = ComponentsManager()
manager.enable_auto_cpu_offload(device=<span class="hljs-string">&quot;cuda&quot;</span>)
pipe = ModularPipeline.from_pretrained(<span class="hljs-string">&quot;MiniMaxAI/MiniMax-H3-Image&quot;</span>, components_manager=manager)
pipe.load_components(dtype=torch.bfloat16)<!----></pre></div><!----> <p>يبلغ حجم المحوّل ومشفّر النص حوالي 62 غيغابايت لكل منهما عند استخدام bfloat16، ولا يتسعان معًا على وحدة معالجة رسومية بسعة 80 غيغابايت، لذا تستخدم الأمثلة التفريغ التلقائي: حيث ينقل <a href="/docs/diffusers/main/ar/api/modular_diffusers/pipeline_components#diffusers.ComponentsManager">ComponentsManager</a> كل مكوّن إلى المعجّل عندما يحتاج إليه كتل. ثم يبلغ ذروة استهلاك ذاكرة صورة بأبعاد 4736x3552 حوالي 65 غيغابايت.</p> <p>من النص إلى الصورة:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!---->prompt = (
<span class="hljs-string">&quot;An overhead photograph of a rustic farm-to-table spread on a weathered wooden table: a round loaf of sourdough &quot;</span>
<span class="hljs-string">&quot;on burlap, wedges of cheese on a dark board, a copper bowl of vegetables, vine tomatoes, olives and walnuts.&quot;</span>
)
image = pipe(
prompt=prompt, height=<span class="hljs-number">3552</span>, width=<span class="hljs-number">4736</span>, generator=torch.Generator().manual_seed(<span class="hljs-number">42</span>), output=<span class="hljs-string">&quot;images&quot;</span>
)[<span class="hljs-number">0</span>]<!----></pre></div><!----> <p>تعديل صورة مرجعية:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
reference = load_image(<span class="hljs-string">&quot;https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/resolve/main/examples/reference1.png&quot;</span>)
image = pipe(
prompt=<span class="hljs-string">&quot;Keep everything in &lt;Picture 1&gt; as it is, but remove the headphones and have the two hosts fist bump.&quot;</span>,
image=reference,
height=<span class="hljs-number">4096</span>,
width=<span class="hljs-number">4096</span>,
generator=torch.Generator().manual_seed(<span class="hljs-number">1234</span>),
output=<span class="hljs-string">&quot;images&quot;</span>,
)[<span class="hljs-number">0</span>]<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="components" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#components"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->المكوّنات<!----></span></h2><!--]--><!----> <table><thead><tr><th>مكوّن</th><th>فئة</th></tr></thead><tbody><tr><td><code>transformer</code></td><td><a href="/docs/diffusers/main/ar/api/models/minimax_h3_image_transformer2d#diffusers.MiniMaxH3ImageTransformer2DModel">MiniMaxH3ImageTransformer2DModel</a></td></tr><tr><td><code>text_encoder</code></td><td><code>Qwen3VLForConditionalGeneration</code></td></tr><tr><td><code>vae</code></td><td><a href="/docs/diffusers/main/ar/api/models/autoencoderkl_minimax_h3_image#diffusers.AutoencoderKLMiniMaxH3Image">AutoencoderKLMiniMaxH3Image</a></td></tr><tr><td><code>tokenizer</code>, <code>processor</code></td><td>مُقسِّم النص الخاصّ بمُشفِّر النص ومعالج <code>Qwen3VLProcessor</code></td></tr><tr><td><code>scheduler</code></td><td><a href="/docs/diffusers/main/ar/api/schedulers/minimax_h3#diffusers.MiniMaxH3Scheduler">MiniMaxH3Scheduler</a></td></tr></tbody></table> <p>المُشفِّر النصي هو نفسه الذي يستخدمه <a href="./minimax_h3">MiniMax-H3</a>. يحتفظ نقطة الفحص بنسخة خاصة بها حتى تكون المستودع مكتفياً ذاتياً؛ حيث يقوم Hub بإزالة التكرار للملفات المتطابقة عبر المستودعات، لذا لا تستهلك النسخة مساحة تخزين إضافية هناك.</p> <!--[1--><h2 class="relative group"><a id="workflows" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#workflows"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->سير العمل<!----></span></h2><!--]--><!----> <p>يتم تحديد سير العمل على مدخل <code>image</code>:</p> <ul><li>يولّد <strong><code>text2image</code></strong> من <code>prompt</code>.</li> <li>يولّد <strong><code>image_conditioned</code></strong> من <code>prompt</code> وواحدة أو أكثر من الصور المرجعية المُمررة كـ<code>image</code>. تشير الأوامر النصية إليها بالترتيب على أنها <code>&lt;Picture 1></code>، <code>&lt;Picture 2></code>، وهكذا. تحافظ الصور المرجعية على أحجامها الخاصة: يُعاد ضبط حجم كل صورة فقط عندما يكون طول حافتها القصيرة خارج نطاق 1024 إلى 2048 بكسل، ولا يُعاد ضبط حجمها أبدًا إلى حجم الصورة المولّدة.</li></ul> <p>يُستخدم الأمر النصي كما هو دون أي قالب محادثة، وتعمل الأوصاف الطويلة والكاملة بشكل أفضل. عادةً ما يحدد أمر التعديل ما يجب الحفاظ عليه، ثم ما يجب تغييره، ثم يصف الصورة المستهدفة بشكل كامل.</p> <!--[1--><h2 class="relative group"><a id="prompt-enhancement" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#prompt-enhancement"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->تحسين الأوامر<!----></span></h2><!--]--><!----> <p><a href="https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE" rel="nofollow">MiniMax-H3-Image-PE</a> هو نموذج توسيع الأوامر من MiniMax: فهو يعيد صياغة الطلب القصير إلى نوع الوصف التفصيلي الذي يعمل معه نموذج الصور بأفضل أداء، ويوصي بنسبة أبعاد. تعمل كتل <code>diffusers/minimax-h3-image-pe-blocks</code> المخصصة عليه كخط أنابيب مستقل. تتطلب هذه الكتل <code>xgrammar</code>، وحوالي 18 غيغابايت من ذاكرة وحدة معالجة الرسوميات.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline
enhancer = ModularPipeline.from_pretrained(<span class="hljs-string">&quot;diffusers/minimax-h3-image-pe-blocks&quot;</span>, trust_remote_code=<span class="hljs-literal">True</span>)
enhancer.load_components(dtype=torch.bfloat16, device_map=<span class="hljs-string">&quot;cuda&quot;</span>)
state = enhancer(prompt=<span class="hljs-string">&quot;a cozy cabin in the snow&quot;</span>)
prompt, aspect_ratio = state.get(<span class="hljs-string">&quot;prompt&quot;</span>), state.get(<span class="hljs-string">&quot;aspect_ratio&quot;</span>)<!----></pre></div><!----> <p>مرّر الصور المرجعية كـ<code>image</code> لتوسيع تعليمات التحرير بدلاً من ذلك. ثم مرّر <code>prompt</code> إلى خط أنابيب الصور، مع <code>height</code> و<code>width</code> تتطابق مع <code>aspect_ratio</code>.</p> <!--[1--><h2 class="relative group"><a id="image-size" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#image-size"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->حجم الصورة<!----></span></h2><!--]--><!----> <p><code>height</code> و<code>width</code> هما حجم الصورة المُعادَة، وقيمتاهما الافتراضية 2048. يولّد النموذج بدقة 4 ميغابكسل أو أكثر: فأي طلب أصغر يُنشأ على لوحة أكبر بنفس نسبة الأبعاد ثم يُعاد تحجيمه، لذا فإن طلبًا بمقاس 1024x1024 يكلف نفس تكلفة طلب بمقاس 2048x2028. يحدد <code>min_generation_area</code> ذلك الحد الأدنى بالبكسل؛ مرّر <code>1024</code> لتوليد الصورة دائمًا بالحجم المطلوب. وفي كلتا الحالتين، تُقرَّب أضلاع اللوحة إلى مضاعفات العدد 32.</p> <p>توصي MiniMax بأبعاد 4096x4096 لنسبة 1:1، و4736x3552 لنسبة 4:3، و5024x3360 لنسبة 3:2، و5472x3072 لنسبة 16:9، و6272x2688 لنسبة 21:9، أو نفس الأبعاد مع تبديل الارتفاع والعرض لتنسيقات البورتريه.</p> <!--[1--><h2 class="relative group"><a id="sampling" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#sampling"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->العينة<!----></span></h2><!--]--><!----> <ul><li>تأخذ نقاط التفتيش عينات في 6 خطوات عبر <code>sample_sigmas</code> الخاصة بها، ولدى المحوّل رأس إخراج واحد لكل خطوة، لذا لا يوجد <code>num_inference_steps</code>.</li> <li>النموذج مُقطّر بالإرشاد، لذا لا يوجد مُوجِّه، أو <code>negative_prompt</code> أو <code>guidance_scale</code>.</li></ul> <!--[1--><h2 class="relative group"><a id="diffusers.MiniMaxH3ImageModularPipeline" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.MiniMaxH3ImageModularPipeline"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->MiniMaxH3ImageModularPipeline<!----></span></h2><!--]--><!----> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.MiniMaxH3ImageModularPipeline"><!----><h3 class="!m-0"><span class="flex-1 break-all md:text-lg bg-gradient-to-r px-2.5 py-1.5 rounded-xl from-indigo-50/70 to-white dark:from-gray-900 dark:to-gray-950 dark:text-indigo-300 text-indigo-700"><svg class="mr-1.5 text-indigo-500 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width=".8em" height=".8em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg><span class="font-light">فئة</span> <span class="font-medium">diffusers.</span><span class="font-semibold">MiniMaxH3ImageModularPipeline</span></span></h3><!----> <a id="diffusers.MiniMaxH3ImageModularPipeline" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.MiniMaxH3ImageModularPipeline"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/minimax_h3_image/modular_pipeline.py#L27" target="_blank"><span>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">blocks<span class="opacity-60">: diffusers.modular_pipelines.modular_pipeline.ModularPipelineBlocks | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">pretrained_model_name_or_path<span class="opacity-60">: str | os.PathLike | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">components_manager<span class="opacity-60">: diffusers.modular_pipelines.components_manager.ComponentsManager | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">collection<span class="opacity-60">: str | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">workflow<span class="opacity-60">: str | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">modular_config_dict<span class="opacity-60">: dict[str, typing.Any] | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">config_dict<span class="opacity-60">: dict[str, typing.Any] | None = None</span></span></span><span class="comma cursor-default"><span class="rounded hover:bg-black hover:text-white dark:hover:bg-white dark:hover:text-black">**kwargs<span class="opacity-60"></span></span></span><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>خط أنابيب ModularPipeline لـ MiniMax-H3-Image: من النص إلى الصورة (<code>text2image</code>) وتحرير الصورة المرجعية
(<code>image_conditioned</code>).</p> <p>يعمل MiniMax-H3-Image على محوّل MiniMax-H3 دون صوت عبر تسلسل واحد مُجمَّع من صفوف النص، وصفوف الصور المرجعية، وصفوف الصورة المولَّدة، وهي إطار كامن واحد. وقد خضع نقطة التفتيش لعملية تقطير مرتين: فالتوجيه مُدمَج في الأوزان، لذا لا يوجد موجِّه، ولا <code>negative_prompt</code>، ولا <code>guidance_scale</code>، كما أنه يُجري العينة على شبكة ثابتة من ست خطوات مع رأس مخرجات واحد من المحوّل لكل خطوة، لذا لا يوجد <code>num_inference_steps</code> أيضًا.</p> <div class="relative group rounded-md"><a id="diffusers.MiniMaxH3ImageModularPipeline.example" class="header-link block pr-0.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.MiniMaxH3ImageModularPipeline.example"><span><svg class="text-smd" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg><!----> <div class=" absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0 "><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent;"></div> تم النسخ</div><!----></button><!----></div> <pre class="language-py "><!----><span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> ModularPipeline
pipe = ModularPipeline.from_pretrained(<span class="hljs-string">&quot;MiniMaxAI/MiniMax-H3-Image&quot;</span>)
pipe.load_components(dtype=torch.bfloat16)<!----></pre></div><!----></div><!----></div> <!--[1--><h2 class="relative group"><a id="diffusers.MiniMaxH3ImageBlocks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#diffusers.MiniMaxH3ImageBlocks"><span><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></span></a> <span><!---->MiniMaxH3ImageBlocks<!----></span></h2><!--]--><!----> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><div><span class="group flex space-x-1.5 items-center text-gray-800 bg-gradient-to-r rounded-tr-lg -mt-4 -ml-4 pt-3 px-2.5" id="diffusers.MiniMaxH3ImageBlocks"><!----><h3 class="!m-0"><span class="flex-1 break-all md:text-lg bg-gradient-to-r px-2.5 py-1.5 rounded-xl from-indigo-50/70 to-white dark:from-gray-900 dark:to-gray-950 dark:text-indigo-300 text-indigo-700"><svg class="mr-1.5 text-indigo-500 inline-block -mt-0.5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" role="img" width=".8em" height=".8em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path class="uim-quaternary" d="M20.23 7.24L12 12L3.77 7.24a1.98 1.98 0 0 1 .7-.71L11 2.76c.62-.35 1.38-.35 2 0l6.53 3.77c.29.173.531.418.7.71z" opacity=".25" fill="currentColor"></path><path class="uim-tertiary" d="M12 12v9.5a2.09 2.09 0 0 1-.91-.21L4.5 17.48a2.003 2.003 0 0 1-1-1.73v-7.5a2.06 2.06 0 0 1 .27-1.01L12 12z" opacity=".5" fill="currentColor"></path><path class="uim-primary" d="M20.5 8.25v7.5a2.003 2.003 0 0 1-1 1.73l-6.62 3.82c-.275.13-.576.198-.88.2V12l8.23-4.76c.175.308.268.656.27 1.01z" fill="currentColor"></path></svg><span class="font-light">فئة</span> <span class="font-medium">diffusers.</span><span class="font-semibold">MiniMaxH3ImageBlocks</span></span></h3><!----> <a id="diffusers.MiniMaxH3ImageBlocks" class="header-link invisible with-hover:group-hover:visible pr-2" href="#diffusers.MiniMaxH3ImageBlocks"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg><!----></a> <!--[0--><a class="!ml-auto !text-gray-400 !no-underline text-sm flex items-center" href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/modular_pipelines/minimax_h3_image/modular_blocks_minimax_h3_image.py#L371" target="_blank"><span>&lt;</span> <span class="hidden md:block mx-0.5 hover:!underline">source</span> <span>></span></a><!--]--></span> <!--[0--><p class="font-mono text-xs md:text-sm !leading-relaxed !my-6"><span>(</span> <!--[--><!--]--> <span>)</span> <!--[-1--><!--]--></p><!--]--> <div class="!mb-10 relative docstring-details "><!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--> <!--[-1--><!--]--></div></div><!----> <p>كتل خط أنابيب معيارية لنموذج MiniMax-H3-Image: <code>text2image</code>، وتعديل الصور المرجعية (<code>image_conditioned</code>) عند تمرير <code>image</code>.</p> <p>سير العمل المدعومة:</p> <ul><li><code>text2image</code>: يتطلب <code>prompt</code></li> <li><code>image_conditioned</code>: يتطلب <code>prompt</code>، <code>image</code></li></ul> <p>المكوّنات:
image_processor (<code>VaeImageProcessor</code>) text_encoder (<code>Qwen3VLForConditionalGeneration</code>) tokenizer
(<code>Qwen2Tokenizer</code>) processor (<code>Qwen3VLProcessor</code>) vae (<code>AutoencoderKLMiniMaxH3Image</code>) scheduler
(<code>MiniMaxH3Scheduler</code>) transformer (<code>MiniMaxH3ImageTransformer2DModel</code>)</p> <p>الإعدادات:
reference_min_short_edge (الافتراضي: 1024) reference_max_short_edge (الافتراضي: 2048) vision_min_short_edge
(الافتراضي: 1024) vision_max_short_edge (الافتراضي: 1024) sample_sigmas (الافتراضي: [1.0, 0.9675236940383911,
0.8875485062599182, 0.75, 0.5327739119529724, 0.23200887441635132, 0.0]): شبكة العينة التي تم تقطير رؤوس المخرجات لكل خطوة في نقطة الحفظ عليها.</p> <p>المدخلات:
image (<code>Image | list</code>, <em>اختياري</em>):
الصورة المرجعية للتحرير، أو قائمة بها. تشير الأوامر النصية إليها بالترتيب على أنها <code>&lt;Picture 1></code>، <code>&lt;Picture 2></code>، …
prompt (<code>str</code>):
الأمر النصي الموجّه للتوليد، وهو نص واحد.
vision_images (<code>list</code>, <em>اختياري</em>):
الصور المرجعية المُعاد تحجيمها لمُشفّر النص.
reference_images (<code>list</code>, <em>اختياري</em>):
الصور المرجعية المُعاد تحجيمها لـ VAE.
generator (<code>Generator</code>, <em>اختياري</em>):
مولّد الطلب. يُسحب منه عيّنة لاحقة واحدة لكل مرجع.
height (<code>int</code>):
ارتفاع الصورة المُعاد إياها بالبكسل.
width (<code>int</code>):
عرض الصورة المُعاد إياها بالبكسل.
min_generation_area (<code>int</code>, <em>اختياري</em>، القيمة الافتراضية 4194304):
أصغر مساحة، بالبكسل، يتم توليد الصورة عليها. يتم توليد <code>height x width</code> أصغر على لوحة يتم تكبيرها إلى هذه المساحة ثم إعادة تحجيمها إلى <code>height x width</code> بعد فك التشفير. مرّر 1024 لتوليد الصورة دائمًا بالحجم المطلوب.
reference_latents (<code>list</code>, <em>اختياري</em>):
القيم الكامنة الشرطية للصور المرجعية. شكلها هو المكان الذي تأتي منه هندسة كل مرجع.
latents (<code>Tensor</code>):
ضوضاء مُولّدة مسبقًا بشكل <code>(1, latent_channels, latent_height, latent_width)</code>، تُستخدم بدلاً من السحب.
reference_noise (<code>list</code>, <em>اختياري</em>):
ضوضاء مُولّدة مسبقًا للصور المرجعية، كل متجه من شكل كل عنصر في <code>reference_latents</code>، تُستخدم بدلاً من عمليات السحب.
*<em>denoiser_input_fields (<code>None</code>,</em>اختياري<em>):
الوصف الهيكلي للتسلسل المُجمّع الذي يقرأه المحوّل بالاسم: <code>token_tags</code>، <code>position_ids</code> ومتجهَا فهارس الصفوف.
output_type (<code>str</code>,</em>اختياري*، القيمة الافتراضية pil):
صيغة الإخراج: ‘pil’، ‘np’، ‘pt’.</p> <p>المخرجات:
صور (<code>list</code>):
الصور المولّدة.</p></div> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/minimax_h3_image.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg><!----> <span><span class="underline">Update</span> on GitHub</span></a><!----> <p></p><!--]--><!----><!--]--><!--]--><!--]--> <!--[-1--><!--]--><!--]-->
<script>
{
__sveltekit_gxjg5b = {
base: "/docs/diffusers/main/en",
assets: "/docs/diffusers/main/en"
};
const element = document.currentScript.parentElement;
Promise.all([
import("/docs/diffusers/main/en/_app/immutable/entry/start.U6TUchwJ.js"),
import("/docs/diffusers/main/en/_app/immutable/entry/app.3qKhPoX-.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 9],
data: [null,null],
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
45.3 kB
·
Xet hash:
3e1e7a01b90b516c587faa522038c679ea562bb1b8d0838f48a2b5ab14066b07

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.