Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Comment exécuter Stable Diffusion avec Core ML","local":"how-to-run-stable-diffusion-with-core-ml","sections":[{"title":"Points de contrôle Core ML de Stable Diffusion","local":"stable-diffusion-core-ml-checkpoints","sections":[],"depth":2},{"title":"Sélectionner la variante Core ML à utiliser","local":"selecting-the-core-ml-variant-to-use","sections":[],"depth":2},{"title":"Inférence Core ML en Python","local":"core-ml-inference-in-python","sections":[{"title":"Télécharger les points de contrôle du modèle","local":"download-the-model-checkpoints","sections":[],"depth":3},{"title":"Inférence","local":"python-inference","sections":[],"depth":3}],"depth":2},{"title":"Inférence Core ML en Swift","local":"core-ml-inference-in-swift","sections":[{"title":"Télécharger","local":"download","sections":[],"depth":3},{"title":"Inférence","local":"swift-inference","sections":[],"depth":3}],"depth":2},{"title":"Fonctionnalités Diffusers prises en charge","local":"supported-diffusers-features","sections":[],"depth":2},{"title":"Application Swift native Diffusers","local":"native-diffusers-swift-app","sections":[],"depth":2}],"depth":1}"/> | |
| <link href="/docs/diffusers/main/en/_app/immutable/entry/start.0S0_iEoG.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/I9eooN77.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/Bupkjr9f.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/entry/app.CPdOxCbw.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/CyvZ3FS5.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/l0QnnOED.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/nodes/0.DteTvmQZ.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/CoSrdQax.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/nodes/334.6lvvFZQx.js" rel="modulepreload"> | |
| <link href="/docs/diffusers/main/en/_app/immutable/chunks/DSPDl1gz.js" rel="modulepreload"> | |
| <!--17v8vq3--><meta name="hf:doc:metadata" content="{"title":"How to run Stable Diffusion with Core ML","local":"how-to-run-stable-diffusion-with-core-ml","sections":[{"title":"Stable Diffusion Core ML Checkpoints","local":"stable-diffusion-core-ml-checkpoints","sections":[],"depth":2},{"title":"Selecting the Core ML Variant to Use","local":"selecting-the-core-ml-variant-to-use","sections":[],"depth":2},{"title":"Core ML Inference in Python","local":"core-ml-inference-in-python","sections":[{"title":"Download the Model Checkpoints","local":"download-the-model-checkpoints","sections":[],"depth":3},{"title":"Inference","local":"python-inference","sections":[],"depth":3}],"depth":2},{"title":"Core ML inference in Swift","local":"core-ml-inference-in-swift","sections":[{"title":"Download","local":"download","sections":[],"depth":3},{"title":"Inference","local":"swift-inference","sections":[],"depth":3}],"depth":2},{"title":"Supported Diffusers Features","local":"supported-diffusers-features","sections":[],"depth":2},{"title":"Native Diffusers Swift app","local":"native-diffusers-swift-app","sections":[],"depth":2}],"depth":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="how-to-run-stable-diffusion-with-core-ml" 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="#how-to-run-stable-diffusion-with-core-ml"><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><!---->Comment exécuter Stable Diffusion avec Core ML<!----></span></h1><!--]--><!----> <p><a href="https://developer.apple.com/documentation/coreml" rel="nofollow">Core ML</a> est le format de modèle et la bibliothèque d’apprentissage automatique pris en charge par les frameworks Apple. Si vous souhaitez exécuter des modèles Stable Diffusion dans vos applications macOS ou iOS/iPadOS, ce guide vous montre comment convertir des points de contrôle PyTorch existants au format Core ML et les utiliser pour l’inférence avec Python ou Swift.</p> <p>Les modèles Core ML peuvent exploiter tous les moteurs de calcul disponibles sur les appareils Apple : le CPU, le GPU et l’Apple Neural Engine (ou ANE, un accélérateur optimisé pour les tenseurs disponible sur les Mac Apple Silicon et les iPhone/iPad modernes). Selon le modèle et l’appareil sur lequel il s’exécute, Core ML peut également combiner les moteurs de calcul, de sorte que certaines parties du modèle s’exécutent sur le CPU tandis que d’autres s’exécutent sur le GPU, par exemple.</p> <blockquote class="tip"><p>Vous pouvez également exécuter le code Python <code>diffusers</code> sur des Mac Apple Silicon en utilisant l'accélérateur <code>mps</code> intégré à PyTorch. Cette approche est expliquée en détail dans <a href="mps">le guide mps</a>, mais elle n'est pas compatible avec les applications natives.</p></blockquote> <!--[1--><h2 class="relative group"><a id="stable-diffusion-core-ml-checkpoints" 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="#stable-diffusion-core-ml-checkpoints"><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><!---->Points de contrôle Core ML de Stable Diffusion<!----></span></h2><!--]--><!----> <p>Les poids (ou points de contrôle) de Stable Diffusion sont stockés au format PyTorch, il est donc nécessaire de les convertir au format Core ML avant de pouvoir les utiliser dans des applications natives.</p> <p>Heureusement, les ingénieurs d’Apple ont développé <a href="https://github.com/apple/ml-stable-diffusion#-converting-models-to-core-ml" rel="nofollow">un outil de conversion</a> basé sur <code>diffusers</code> pour convertir les points de contrôle PyTorch en Core ML.</p> <p>Avant de convertir un modèle, prenez un moment pour explorer le Hugging Face Hub – il est probable que le modèle qui vous intéresse soit déjà disponible au format Core ML :</p> <ul><li>l'organisation <a href="https://huggingface.co/apple" rel="nofollow">Apple</a> comprend les versions 1.4, 1.5, 2.0 base et 2.1 base de Stable Diffusion</li> <li><a href="https://huggingface.co/coreml-community" rel="nofollow">coreml community</a> inclut des modèles finement ajustés</li> <li>utilisez ce <a href="https://huggingface.co/models?pipeline_tag=text-to-image&library=coreml&p=2&sort=likes" rel="nofollow">filtre</a> pour renvoyer tous les points de contrôle Core ML disponibles</li></ul> <p>Si vous ne trouvez pas le modèle qui vous intéresse, nous vous recommandons de suivre les instructions pour <a href="https://github.com/apple/ml-stable-diffusion#-converting-models-to-core-ml" rel="nofollow">Convertir les modèles en Core ML</a> fournies par Apple.</p> <!--[1--><h2 class="relative group"><a id="selecting-the-core-ml-variant-to-use" 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="#selecting-the-core-ml-variant-to-use"><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><!---->Sélectionner la variante Core ML à utiliser<!----></span></h2><!--]--><!----> <p>Les modèles Stable Diffusion peuvent être convertis en différentes variantes Core ML destinées à des usages spécifiques :</p> <ul><li><p>Le type de blocs d'attention utilisés. L'opération d'attention sert à « prêter attention » aux relations entre différentes zones des représentations d'image et à comprendre comment les représentations d'image et de texte sont liées. L'attention est gourmande en calculs et en mémoire, il existe donc différentes implémentations qui tiennent compte des caractéristiques matérielles des différents appareils. Pour les modèles Stable Diffusion Core ML, il existe deux variantes d'attention :</p> <ul><li><code>split_einsum</code> (<a href="https://machinelearning.apple.com/research/neural-engine-transformers" rel="nofollow">introduit par Apple</a>) est optimisé pour les dispositifs ANE, disponibles dans les iPhone, iPad et ordinateurs de la série M modernes.</li> <li>L’attention « originale » (l’implémentation de base utilisée dans <code>diffusers</code>) n’est compatible qu’avec CPU/GPU et non avec ANE. Il peut être <em>plus rapide</em> d’exécuter votre modèle sur CPU + GPU en utilisant l’attention <code>original</code> que sur ANE. Consultez <a href="https://huggingface.co/blog/fast-mac-diffusers#performance-benchmarks" rel="nofollow">ce benchmark de performances</a> ainsi que certaines <a href="https://github.com/huggingface/swift-coreml-diffusers/issues/31" rel="nofollow">mesures supplémentaires fournies par la communauté</a> pour plus de détails.</li></ul></li> <li><p>Le framework d'inférence pris en charge.</p> <ul><li><code>packages</code> conviennent à l’inférence Python. Ils permettent de tester les modèles Core ML convertis avant de tenter de les intégrer dans des applications natives, ou d’explorer les performances de Core ML sans avoir à prendre en charge les applications natives. Par exemple, une application avec une interface web peut tout à fait utiliser un backend Core ML Python.</li> <li>Les modèles <code>compiled</code> sont requis pour le code Swift. Les modèles <code>compiled</code> du Hub divisent les poids du grand modèle UNet en plusieurs fichiers pour assurer la compatibilité avec les appareils iOS et iPadOS. Cela correspond à l’option de conversion <a href="https://github.com/apple/ml-stable-diffusion#-converting-models-to-core-ml" rel="nofollow"><code>--chunk-unet</code></a>. Si vous souhaitez prendre en charge les applications natives, vous devez sélectionner la variante <code>compiled</code>.</li></ul></li></ul> <p>Les <a href="https://huggingface.co/apple/coreml-stable-diffusion-v1-4/tree/main" rel="nofollow">modèles</a> officiels de Stable Diffusion pour Core ML incluent ces variantes, mais ceux de la communauté peuvent varier :</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> Copié</div><!----></button><!----></div> <pre class=" "><!---->coreml-stable-<span class="hljs-keyword">diffusion-v1-4 | |
| </span>├── README.md | |
| ├── <span class="hljs-keyword">original | |
| </span>│ ├── compiled | |
| │ └── packages | |
| └── split_einsum | |
| ├── compiled | |
| └── packages<!----></pre></div><!----> <p>Vous pouvez télécharger et utiliser la variante dont vous avez besoin, comme indiqué ci-dessous.</p> <!--[1--><h2 class="relative group"><a id="core-ml-inference-in-python" 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="#core-ml-inference-in-python"><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><!---->Inférence Core ML en Python<!----></span></h2><!--]--><!----> <p>Installez les bibliothèques suivantes pour exécuter l'inférence Core ML en Python :</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> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->pip install huggingface_hub | |
| pip install git+https://github.com/apple/ml-stable-diffusion<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="download-the-model-checkpoints" 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="#download-the-model-checkpoints"><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><!---->Télécharger les points de contrôle du modèle<!----></span></h3><!--]--><!----> <p>Pour exécuter l'inférence en Python, utilisez l'une des versions stockées dans les dossiers <code>packages</code>, car les versions <code>compiled</code> ne sont compatibles qu'avec Swift. Vous pouvez choisir d'utiliser l'attention <code>original</code> ou <code>split_einsum</code>.</p> <p>Voici comment télécharger la variante d'attention <code>original</code> depuis le Hub vers un répertoire nommé <code>models</code> :</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> Copié</div><!----></button><!----></div> <pre class="language-Python "><!----><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> snapshot_download | |
| <span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path | |
| repo_id = <span class="hljs-string">"apple/coreml-stable-diffusion-v1-4"</span> | |
| variant = <span class="hljs-string">"original/packages"</span> | |
| model_path = Path(<span class="hljs-string">"./models"</span>) / (repo_id.split(<span class="hljs-string">"/"</span>)[-<span class="hljs-number">1</span>] + <span class="hljs-string">"_"</span> + variant.replace(<span class="hljs-string">"/"</span>, <span class="hljs-string">"_"</span>)) | |
| snapshot_download(repo_id, allow_patterns=<span class="hljs-string">f"<span class="hljs-subst">{variant}</span>/*"</span>, local_dir=model_path, local_dir_use_symlinks=<span class="hljs-literal">False</span>) | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Model downloaded at <span class="hljs-subst">{model_path}</span>"</span>)<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="python-inference" 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="#python-inference"><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><!---->Inférence<!----></span></h3><!--]--><!----> <p>Une fois que vous avez téléchargé un instantané du modèle, vous pouvez le tester à l'aide du script Python d'Apple.</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> Copié</div><!----></button><!----></div> <pre class="language-shell "><!---->python -m python_coreml_stable_diffusion.pipeline --prompt "a photo of an astronaut riding a horse on mars" -i ./models/coreml-stable-diffusion-v1-4_original_packages/original/packages -o </path/to/output/image> --compute-unit CPU_AND_GPU --seed 93<!----></pre></div><!----> <p>Transmettez le chemin du point de contrôle téléchargé au script avec le drapeau <code>-i</code>. <code>--compute-unit</code> indique le matériel que vous souhaitez autoriser pour l'inférence. Il doit être l'une des options suivantes : <code>ALL</code>, <code>CPU_AND_GPU</code>, <code>CPU_ONLY</code>, <code>CPU_AND_NE</code>. Vous pouvez également fournir un chemin de sortie facultatif et une graine pour la reproductibilité.</p> <p>Le script d’inférence suppose que vous utilisez la version originale du modèle Stable Diffusion, <code>CompVis/stable-diffusion-v1-4</code>. Si vous utilisez un autre modèle, vous <em>devez</em> spécifier son identifiant Hub dans la ligne de commande d’inférence, à l’aide de l’option <code>--model-version</code>. Cela fonctionne pour les modèles déjà pris en charge ainsi que pour les modèles personnalisés que vous avez entraînés ou affinés vous-même.</p> <p>Par exemple, si vous souhaitez utiliser <a href="https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow"><code>stable-diffusion-v1-5/stable-diffusion-v1-5</code></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> Copié</div><!----></button><!----></div> <pre class="language-shell "><!---->python -m python_coreml_stable_diffusion.pipeline --prompt "a photo of an astronaut riding a horse on mars" --compute-unit ALL -o output --seed 93 -i models/coreml-stable-diffusion-v1-5_original_packages --model-version stable-diffusion-v1-5/stable-diffusion-v1-5<!----></pre></div><!----> <!--[1--><h2 class="relative group"><a id="core-ml-inference-in-swift" 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="#core-ml-inference-in-swift"><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><!---->Inférence Core ML en Swift<!----></span></h2><!--]--><!----> <p>L’exécution de l’inférence en Swift est légèrement plus rapide qu’en Python, car les modèles sont déjà compilés au format <code>mlmodelc</code>. Cette différence est perceptible au démarrage de l’application, lorsque le modèle est chargé, mais elle ne devrait pas être notable si vous effectuez plusieurs générations par la suite.</p> <!--[2--><h3 class="relative group"><a id="download" 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="#download"><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><!---->Télécharger<!----></span></h3><!--]--><!----> <p>Pour exécuter l'inférence en Swift sur votre Mac, vous avez besoin de l'une des versions de point de contrôle <code>compiled</code>. Nous vous recommandons de les télécharger localement à l'aide de code Python similaire à l'exemple précédent, mais avec l'une des variantes <code>compiled</code> :</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> Copié</div><!----></button><!----></div> <pre class="language-Python "><!----><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> snapshot_download | |
| <span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path | |
| repo_id = <span class="hljs-string">"apple/coreml-stable-diffusion-v1-4"</span> | |
| variant = <span class="hljs-string">"original/compiled"</span> | |
| model_path = Path(<span class="hljs-string">"./models"</span>) / (repo_id.split(<span class="hljs-string">"/"</span>)[-<span class="hljs-number">1</span>] + <span class="hljs-string">"_"</span> + variant.replace(<span class="hljs-string">"/"</span>, <span class="hljs-string">"_"</span>)) | |
| snapshot_download(repo_id, allow_patterns=<span class="hljs-string">f"<span class="hljs-subst">{variant}</span>/*"</span>, local_dir=model_path, local_dir_use_symlinks=<span class="hljs-literal">False</span>) | |
| <span class="hljs-built_in">print</span>(<span class="hljs-string">f"Model downloaded at <span class="hljs-subst">{model_path}</span>"</span>)<!----></pre></div><!----> <!--[2--><h3 class="relative group"><a id="swift-inference" 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="#swift-inference"><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><!---->Inférence<!----></span></h3><!--]--><!----> <p>Pour exécuter l'inférence, veuillez cloner le dépôt d'Apple :</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> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->git <span class="hljs-built_in">clone</span> https://github.com/apple/ml-stable-diffusion | |
| <span class="hljs-built_in">cd</span> ml-stable-diffusion<!----></pre></div><!----> <p>Puis utilisez l’outil en ligne de commande d’Apple, <a href="https://www.swift.org/package-manager/#" rel="nofollow">Swift Package Manager</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> Copié</div><!----></button><!----></div> <pre class="language-bash "><!---->swift run StableDiffusionSample --resource-path models/coreml-stable-diffusion-v1-4_original_compiled --compute-units all <span class="hljs-string">"a photo of an astronaut riding a horse on mars"</span><!----></pre></div><!----> <p>Vous devez spécifier dans <code>--resource-path</code> l'un des points de contrôle téléchargés à l'étape précédente, veuillez donc vous assurer qu'il contient des bundles Core ML compilés avec l'extension <code>.mlmodelc</code>. La valeur de <code>--compute-units</code> doit être l'une de ces valeurs : <code>all</code>, <code>cpuOnly</code>, <code>cpuAndGPU</code>, <code>cpuAndNeuralEngine</code>.</p> <p>Pour plus de détails, veuillez consulter les <a href="https://github.com/apple/ml-stable-diffusion" rel="nofollow">instructions du dépôt d’Apple</a>.</p> <!--[1--><h2 class="relative group"><a id="supported-diffusers-features" 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="#supported-diffusers-features"><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><!---->Fonctionnalités Diffusers prises en charge<!----></span></h2><!--]--><!----> <p>Les modèles Core ML et le code d’inférence ne prennent pas en charge de nombreuses fonctionnalités, options et flexibilités de 🧨 Diffusers. Voici quelques-unes des limites à garder à l’esprit :</p> <ul><li>Les modèles Core ML ne conviennent que pour l'inférence. Ils ne peuvent pas être utilisés pour l'entraînement ou l'ajustement fin.</li> <li>Seuls deux planificateurs ont été portés vers Swift : le planificateur par défaut utilisé par Stable Diffusion et <code>DPMSolverMultistepScheduler</code>, que nous avons porté vers Swift à partir de notre implémentation <code>diffusers</code>. Nous vous recommandons d’utiliser <code>DPMSolverMultistepScheduler</code>, car il produit une qualité équivalente en environ la moitié du nombre d’étapes.</li> <li>Les prompts négatifs, l'échelle de guidage sans classifieur et les tâches d'image à image sont disponibles dans le code d'inférence. Les fonctionnalités avancées telles que le guidage de profondeur, ControlNet et les upscalers latents ne sont pas encore disponibles.</li></ul> <p>Le dépôt de <a href="https://github.com/apple/ml-stable-diffusion" rel="nofollow">conversion et d’inférence</a> d’Apple et notre propre dépôt <a href="https://github.com/huggingface/swift-coreml-diffusers" rel="nofollow">swift-coreml-diffusers</a> sont conçus comme des démonstrations technologiques permettant à d’autres développeurs de s’en inspirer pour construire leurs propres applications.</p> <p>Si vous estimez qu'il manque des fonctionnalités, n'hésitez pas à ouvrir une demande de fonctionnalité ou, mieux encore, une PR de contribution 🙂.</p> <!--[1--><h2 class="relative group"><a id="native-diffusers-swift-app" 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="#native-diffusers-swift-app"><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><!---->Application Swift native Diffusers<!----></span></h2><!--]--><!----> <p>Une façon simple d’exécuter Stable Diffusion sur votre propre matériel Apple est d’utiliser <a href="https://github.com/huggingface/swift-coreml-diffusers" rel="nofollow">notre dépôt open source en Swift</a>, basé sur <code>diffusers</code> et le dépôt de conversion et d’inférence d’Apple. Vous pouvez étudier le code, le compiler avec <a href="https://developer.apple.com/xcode/" rel="nofollow">Xcode</a> et l’adapter à vos besoins. Pour votre confort, il existe également une <a href="https://apps.apple.com/app/diffusers/id1666309574" rel="nofollow">application Mac autonome sur l’App Store</a>, ce qui vous permet de l’essayer sans avoir à gérer le code ou l’IDE. Si vous êtes développeur et avez déterminé que Core ML est la meilleure solution pour construire votre application Stable Diffusion, vous pouvez utiliser le reste de ce guide pour démarrer votre projet. Nous avons hâte de voir ce que vous allez créer 🙂.</p> <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/optimization/coreml.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_1qsdbwf = { | |
| 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.0S0_iEoG.js"), | |
| import("/docs/diffusers/main/en/_app/immutable/entry/app.CPdOxCbw.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 334], | |
| data: [null,null], | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 45.7 kB
- Xet hash:
- f0f2493b6e0267a1df9391d30763a398e75404c4b5b1d4c5999761c495817864
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.