Buckets:
| import"../chunks/DsnmJJEf.js";import{i as J,h as U,H as a,D as i,E as k,s as P,a as j}from"../chunks/BtE7mKSK.js";import{p as C,o as N,s as e,f as v,a as r,b as F,c as l,d,r as p,n as I}from"../chunks/jDjavuwI.js";import{E as Z}from"../chunks/SrSJA0zO.js";const E='{"title":"HiDreamImage","local":"hidreamimage","sections":[{"title":"Available models","local":"available-models","sections":[],"depth":2},{"title":"HiDreamImagePipeline","local":"diffusers.HiDreamImagePipeline","sections":[],"depth":2},{"title":"HiDreamImagePipelineOutput","local":"diffusers.pipelines.hidream_image.pipeline_output.HiDreamImagePipelineOutput","sections":[],"depth":2}],"depth":1}';var G=d('<meta name="hf:doc:metadata"/>'),z=d("<p>Examples:</p> <!>",1),L=d('<p></p> <!> <p><a href="https://huggingface.co/HiDream-ai" rel="nofollow">HiDream-I1</a> by HiDream.ai</p> <blockquote><p>[!TIP][Caching](../../optimization/cache) may also speed up inference by storing and reusing intermediate outputs.</p></blockquote> <!> <p>The following models are available for the <a href="/docs/diffusers/pr_14333/en/api/pipelines/hidream#diffusers.HiDreamImagePipeline">HiDreamImagePipeline</a> pipeline:</p> <table><thead><tr><th align="left">Model name</th><th align="left">Description</th></tr></thead><tbody><tr><td align="left"><a href="https://huggingface.co/HiDream-ai/HiDream-I1-Full" rel="nofollow"><code>HiDream-ai/HiDream-I1-Full</code></a></td><td align="left">-</td></tr><tr><td align="left"><a href="https://huggingface.co/HiDream-ai/HiDream-I1-Dev" rel="nofollow"><code>HiDream-ai/HiDream-I1-Dev</code></a></td><td align="left">-</td></tr><tr><td align="left"><a href="https://huggingface.co/HiDream-ai/HiDream-I1-Fast" rel="nofollow"><code>HiDream-ai/HiDream-I1-Fast</code></a></td><td align="left">-</td></tr></tbody></table> <!> <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 class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Function invoked when calling the pipeline for generation.</p> <!></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Output class for HiDreamImage pipelines.</p></div> <!> <p></p>',1);function X(w,T){C(T,!1),N(()=>{new URLSearchParams(window.location.search).get("fw")}),J();var m=L();U("13tj1xm",t=>{var s=G();P(s,"content",E),r(t,s)});var c=e(v(m),2);a(c,{title:"HiDreamImage",local:"hidreamimage",headingTag:"h1"});var g=e(c,6);a(g,{title:"Available models",local:"available-models",headingTag:"h2"});var _=e(g,6);a(_,{title:"HiDreamImagePipeline",local:"diffusers.HiDreamImagePipeline",headingTag:"h2"});var n=e(_,2),h=l(n);i(h,{name:"class diffusers.HiDreamImagePipeline",anchor:"diffusers.HiDreamImagePipeline",source:"https://github.com/huggingface/diffusers/blob/vr_14333/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py#L159",parameters:[{name:"scheduler",val:": FlowMatchEulerDiscreteScheduler"},{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"text_encoder_3",val:": T5EncoderModel"},{name:"tokenizer_3",val:": T5Tokenizer"},{name:"text_encoder_4",val:": LlamaForCausalLM"},{name:"tokenizer_4",val:": TokenizersBackend"},{name:"transformer",val:": HiDreamImageTransformer2DModel"}]});var u=e(h,2),f=l(u);i(f,{name:"__call__",anchor:"diffusers.HiDreamImagePipeline.__call__",source:"https://github.com/huggingface/diffusers/blob/vr_14333/src/diffusers/pipelines/hidream_image/pipeline_hidream_image.py#L674",parameters:[{name:"prompt",val:": str | list[str] = None"},{name:"prompt_2",val:": str | list[str] | None = None"},{name:"prompt_3",val:": str | list[str] | None = None"},{name:"prompt_4",val:": str | list[str] | None = None"},{name:"height",val:": int | None = None"},{name:"width",val:": int | None = None"},{name:"num_inference_steps",val:": int = 50"},{name:"sigmas",val:": list[float] | None = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": str | list[str] | None = None"},{name:"negative_prompt_2",val:": str | list[str] | None = None"},{name:"negative_prompt_3",val:": str | list[str] | None = None"},{name:"negative_prompt_4",val:": str | list[str] | None = None"},{name:"num_images_per_prompt",val:": int | None = 1"},{name:"generator",val:": typing.Union[torch.Generator, list[torch.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds_t5",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds_llama3",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds_t5",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds_llama3",val:": typing.Optional[torch.FloatTensor] = None"},{name:"pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_pooled_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": str | None = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"attention_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"callback_on_step_end",val:": typing.Optional[typing.Callable[[int, int], NoneType]] = None"},{name:"callback_on_step_end_tensor_inputs",val:": list = ['latents']"},{name:"max_sequence_length",val:": int = 128"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.HiDreamImagePipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>. | |
| instead.`,name:"prompt"},{anchor:"diffusers.HiDreamImagePipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to be sent to <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is | |
| will be used instead.`,name:"prompt_2"},{anchor:"diffusers.HiDreamImagePipeline.__call__.prompt_3",description:`<strong>prompt_3</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to be sent to <code>tokenizer_3</code> and <code>text_encoder_3</code>. If not defined, <code>prompt</code> is | |
| will be used instead.`,name:"prompt_3"},{anchor:"diffusers.HiDreamImagePipeline.__call__.prompt_4",description:`<strong>prompt_4</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts to be sent to <code>tokenizer_4</code> and <code>text_encoder_4</code>. If not defined, <code>prompt</code> is | |
| will be used instead.`,name:"prompt_4"},{anchor:"diffusers.HiDreamImagePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"height"},{anchor:"diffusers.HiDreamImagePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image. This is set to 1024 by default for the best results.`,name:"width"},{anchor:"diffusers.HiDreamImagePipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| The number of denoising steps. More denoising steps usually lead to a higher quality image at the | |
| expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.HiDreamImagePipeline.__call__.sigmas",description:`<strong>sigmas</strong> (<code>list[float]</code>, <em>optional</em>) — | |
| Custom sigmas to use for the denoising process with schedulers which support a <code>sigmas</code> argument in | |
| their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is passed | |
| will be used.`,name:"sigmas"},{anchor:"diffusers.HiDreamImagePipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 3.5) — | |
| Embedded guiddance scale is enabled by setting <code>guidance_scale</code> > 1. Higher <code>guidance_scale</code> encourages | |
| a model to generate images more aligned with <code>prompt</code> at the expense of lower image quality.</p> | |
| <p>Guidance-distilled models approximates true classifer-free guidance for <code>guidance_scale</code> > 1. Refer to | |
| the <a href="https://huggingface.co/papers/2210.03142" rel="nofollow">paper</a> to learn more.`,name:"guidance_scale"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. If not defined, one has to pass | |
| <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>true_cfg_scale</code> is | |
| not greater than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and | |
| <code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in all the text-encoders.`,name:"negative_prompt_2"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_prompt_3",description:`<strong>negative_prompt_3</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_3</code> and | |
| <code>text_encoder_3</code>. If not defined, <code>negative_prompt</code> is used in all the text-encoders.`,name:"negative_prompt_3"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_prompt_4",description:`<strong>negative_prompt_4</strong> (<code>str</code> or <code>list[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_4</code> and | |
| <code>text_encoder_4</code>. If not defined, <code>negative_prompt</code> is used in all the text-encoders.`,name:"negative_prompt_4"},{anchor:"diffusers.HiDreamImagePipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.HiDreamImagePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>list[torch.Generator]</code>, <em>optional</em>) — | |
| One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a> | |
| to make generation deterministic.`,name:"generator"},{anchor:"diffusers.HiDreamImagePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image | |
| generation. Can be used to tweak the same generation with different prompts. If not provided, a latents | |
| tensor will be generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.HiDreamImagePipeline.__call__.prompt_embeds_t5",description:`<strong>prompt_embeds_t5</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated T5 text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If | |
| not provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds_t5"},{anchor:"diffusers.HiDreamImagePipeline.__call__.prompt_embeds_llama3",description:`<strong>prompt_embeds_llama3</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated LLaMA3 text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. | |
| If not provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds_llama3"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_prompt_embeds_t5",description:`<strong>negative_prompt_embeds_t5</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated negative T5 text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt | |
| weighting. If not provided, embeddings will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds_t5"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_prompt_embeds_llama3",description:`<strong>negative_prompt_embeds_llama3</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated negative LLaMA3 text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt | |
| weighting. If not provided, embeddings will be generated from <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds_llama3"},{anchor:"diffusers.HiDreamImagePipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. | |
| If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.HiDreamImagePipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt | |
| weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code> | |
| input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.HiDreamImagePipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| The output format of the generate image. Choose between | |
| <a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.HiDreamImagePipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <code>~pipelines.flux.FluxPipelineOutput</code> instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.HiDreamImagePipeline.__call__.attention_kwargs",description:`<strong>attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) — | |
| A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under | |
| <code>self.processor</code> in | |
| <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"attention_kwargs"},{anchor:"diffusers.HiDreamImagePipeline.__call__.callback_on_step_end",description:`<strong>callback_on_step_end</strong> (<code>Callable</code>, <em>optional</em>) — | |
| A function that calls at the end of each denoising steps during the inference. The function is called | |
| with the following arguments: <code>callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)</code>. <code>callback_kwargs</code> will include a list of all tensors as specified by | |
| <code>callback_on_step_end_tensor_inputs</code>.`,name:"callback_on_step_end"},{anchor:"diffusers.HiDreamImagePipeline.__call__.callback_on_step_end_tensor_inputs",description:`<strong>callback_on_step_end_tensor_inputs</strong> (<code>list</code>, <em>optional</em>) — | |
| The list of tensor inputs for the <code>callback_on_step_end</code> function. The tensors specified in the list | |
| will be passed as <code>callback_kwargs</code> argument. You will only be able to include variables listed in the | |
| <code>._callback_tensor_inputs</code> attribute of your pipeline class.`,name:"callback_on_step_end_tensor_inputs"},{anchor:"diffusers.HiDreamImagePipeline.__call__.max_sequence_length",description:"<strong>max_sequence_length</strong> (<code>int</code> defaults to 128) — Maximum sequence length to use with the <code>prompt</code>.",name:"max_sequence_length"}],returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.hidream_image.HiDreamImagePipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple</code>. When | |
| returning a tuple, the first element is a list with the generated. images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>~pipelines.hidream_image.HiDreamImagePipelineOutput</code> or <code>tuple</code></p> | |
| `});var M=e(f,4);Z(M,{anchor:"diffusers.HiDreamImagePipeline.__call__.example",children:(t,s)=>{var y=z(),H=e(v(y),2);j(H,{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUyQyUyMExsYW1hRm9yQ2F1c2FsTE0lMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwSGlEcmVhbUltYWdlUGlwZWxpbmUlMEElMEF0b2tlbml6ZXJfNCUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1ldGEtbGxhbWElMkZNZXRhLUxsYW1hLTMuMS04Qi1JbnN0cnVjdCUyMiklMEF0ZXh0X2VuY29kZXJfNCUyMCUzRCUyMExsYW1hRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMm1ldGEtbGxhbWElMkZNZXRhLUxsYW1hLTMuMS04Qi1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9oaWRkZW5fc3RhdGVzJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG91dHB1dF9hdHRlbnRpb25zJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guYmZsb2F0MTYlMkMlMEEpJTBBJTBBcGlwZSUyMCUzRCUyMEhpRHJlYW1JbWFnZVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJIaURyZWFtLWFpJTJGSGlEcmVhbS1JMS1GdWxsJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyXzQlM0R0b2tlbml6ZXJfNCUyQyUwQSUyMCUyMCUyMCUyMHRleHRfZW5jb2Rlcl80JTNEdGV4dF9lbmNvZGVyXzQlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2JTJDJTBBKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJ0ElMjBjYXQlMjBob2xkaW5nJTIwYSUyMHNpZ24lMjB0aGF0JTIwc2F5cyUyMCUyMkhpLURyZWFtcy5haSUyMi4nJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNEMTAyNCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENS4wJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEdG9yY2guR2VuZXJhdG9yKCUyMmN1ZGElMjIpLm1hbnVhbF9zZWVkKDApJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJvdXRwdXQucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LlamaForCausalLM | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> HiDreamImagePipeline | |
| <span class="hljs-meta">>>> </span>tokenizer_4 = AutoTokenizer.from_pretrained(<span class="hljs-string">"meta-llama/Meta-Llama-3.1-8B-Instruct"</span>) | |
| <span class="hljs-meta">>>> </span>text_encoder_4 = LlamaForCausalLM.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"meta-llama/Meta-Llama-3.1-8B-Instruct"</span>, | |
| <span class="hljs-meta">... </span> output_hidden_states=<span class="hljs-literal">True</span>, | |
| <span class="hljs-meta">... </span> output_attentions=<span class="hljs-literal">True</span>, | |
| <span class="hljs-meta">... </span> torch_dtype=torch.bfloat16, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe = HiDreamImagePipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"HiDream-ai/HiDream-I1-Full"</span>, | |
| <span class="hljs-meta">... </span> tokenizer_4=tokenizer_4, | |
| <span class="hljs-meta">... </span> text_encoder_4=text_encoder_4, | |
| <span class="hljs-meta">... </span> torch_dtype=torch.bfloat16, | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe.enable_model_cpu_offload() | |
| <span class="hljs-meta">>>> </span>image = pipe( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">'A cat holding a sign that says "Hi-Dreams.ai".'</span>, | |
| <span class="hljs-meta">... </span> height=<span class="hljs-number">1024</span>, | |
| <span class="hljs-meta">... </span> width=<span class="hljs-number">1024</span>, | |
| <span class="hljs-meta">... </span> guidance_scale=<span class="hljs-number">5.0</span>, | |
| <span class="hljs-meta">... </span> num_inference_steps=<span class="hljs-number">50</span>, | |
| <span class="hljs-meta">... </span> generator=torch.Generator(<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>), | |
| <span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"output.png"</span>)`,lang:"py",wrap:!1}),r(t,y)},$$slots:{default:!0}}),p(u),p(n);var b=e(n,2);a(b,{title:"HiDreamImagePipelineOutput",local:"diffusers.pipelines.hidream_image.pipeline_output.HiDreamImagePipelineOutput",headingTag:"h2"});var o=e(b,2),x=l(o);i(x,{name:"class diffusers.pipelines.hidream_image.pipeline_output.HiDreamImagePipelineOutput",anchor:"diffusers.pipelines.hidream_image.pipeline_output.HiDreamImagePipelineOutput",source:"https://github.com/huggingface/diffusers/blob/vr_14333/src/diffusers/pipelines/hidream_image/pipeline_output.py#L24",parameters:[{name:"images",val:": list[PIL.Image.Image] | numpy.ndarray"}],parametersDescription:[{anchor:"diffusers.pipelines.hidream_image.pipeline_output.HiDreamImagePipelineOutput.images",description:`<strong>images</strong> (<code>list[PIL.Image.Image]</code> or <code>np.ndarray</code>) — | |
| list of denoised PIL images of length <code>batch_size</code> or numpy array of shape <code>(batch_size, height, width, num_channels)</code>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"}]}),I(2),p(o);var D=e(o,2);k(D,{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/hidream.md"}),I(2),r(w,m),F()}export{X as component}; | |
Xet Storage Details
- Size:
- 22.9 kB
- Xet hash:
- 33a17c6462cc26fb5eb8207e9a94412c22c110e1f7c01bdd071b07dc3036bcc8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.