Diffusers documentation

HunyuanImage2.1

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

HunyuanImage2.1

HunyuanImage-2.1 は、2K(2048 x 2048)解像度の画像を生成できる 17B パラメータのテキストから画像を生成するモデルです

HunyuanImage-2.1には、以下のバリエーションがあります:

モデルタイプモデルID
HunyuanImage-2.1hunyuanvideo-community/HunyuanImage-2.1-Diffusers
HunyuanImage-2.1-Distilledhunyuanvideo-community/HunyuanImage-2.1-Distilled-Diffusers
HunyuanImage-2.1-Refinerhunyuanvideo-community/HunyuanImage-2.1-Refiner-Diffusers

Caching は、中間出力を保存して再利用することで、推論の高速化にも貢献します。

HunyuanImage-2.1

HunyuanImage-2.1 は、デノイジングループにおいて Adaptive Projected Guidance (APG) と Classifier-Free Guidance (CFG) を組み合わせて適用します。HunyuanImagePipeline には guider コンポーネント(Guider について詳しくはこちら)があり、実行時に guidance_scale パラメータを受け取りません。guider 関連のパラメータ(例: guidance_scale)を変更するには、代わりに guider の設定を更新できます。

import torch
from diffusers import HunyuanImagePipeline

pipe = HunyuanImagePipeline.from_pretrained(
    "hunyuanvideo-community/HunyuanImage-2.1-Diffusers", 
    dtype=torch.bfloat16
)
pipe = pipe.to("cuda")  # or "mps", "xpu", "cpu"

guiderオブジェクトを調べることができます。

>>> pipe.guider
AdaptiveProjectedMixGuidance {
  "_class_name": "AdaptiveProjectedMixGuidance",
  "_diffusers_version": "0.36.0.dev0",
  "adaptive_projected_guidance_momentum": -0.5,
  "adaptive_projected_guidance_rescale": 10.0,
  "adaptive_projected_guidance_scale": 10.0,
  "adaptive_projected_guidance_start_step": 5,
  "enabled": true,
  "eta": 0.0,
  "guidance_rescale": 0.0,
  "guidance_scale": 3.5,
  "start": 0.0,
  "stop": 1.0,
  "use_original_formulation": false
}

State:
  step: None
  num_inference_steps: None
  timestep: None
  count_prepared: 0
  enabled: True
  num_conditions: 2
  momentum_buffer: None
  is_apg_enabled: False
  is_cfg_enabled: True

異なる設定でguiderを更新するには、new()メソッドを使用します。例えば、他のすべてのデフォルトのguidanceパラメータを維持したまま、guidance_scale=5.0で画像を生成するには:

import torch
from diffusers import HunyuanImagePipeline

pipe = HunyuanImagePipeline.from_pretrained(
    "hunyuanvideo-community/HunyuanImage-2.1-Diffusers", 
    dtype=torch.bfloat16
)
pipe = pipe.to("cuda")  # or "mps", "xpu", "cpu"

# Update the guider configuration
pipe.guider = pipe.guider.new(guidance_scale=5.0)

prompt = (
    "A cute, cartoon-style anthropomorphic penguin plush toy with fluffy fur, standing in a painting studio, "
    "wearing a red knitted scarf and a red beret with the word 'Tencent' on it, holding a paintbrush with a "
    "focused expression as it paints an oil painting of the Mona Lisa, rendered in a photorealistic photographic style."
)

image = pipe(
    prompt=prompt, 
    num_inference_steps=50, 
    height=2048, 
    width=2048,
).images[0]
image.save("image.png")

HunyuanImage-2.1-Distilled

guidance-distilled チェックポイントでは、distilled_guidance_scale を使用してください。

import torch
from diffusers import HunyuanImagePipeline
pipe = HunyuanImagePipeline.from_pretrained("hunyuanvideo-community/HunyuanImage-2.1-Distilled-Diffusers", dtype=torch.bfloat16)
pipe = pipe.to("cuda")  # or "mps", "xpu", "cpu"

prompt = (
    "A cute, cartoon-style anthropomorphic penguin plush toy with fluffy fur, standing in a painting studio, "
    "wearing a red knitted scarf and a red beret with the word 'Tencent' on it, holding a paintbrush with a "
    "focused expression as it paints an oil painting of the Mona Lisa, rendered in a photorealistic photographic style."
)

out = pipe(
    prompt,
    num_inference_steps=8,
    distilled_guidance_scale=3.25,
    height=2048,
    width=2048,
    generator=generator,
).images[0]

HunyuanImagePipeline

class diffusers.HunyuanImagePipeline

< >

( scheduler: FlowMatchEulerDiscreteSchedulervae: AutoencoderKLHunyuanImagetext_encoder: Qwen2_5_VLForConditionalGenerationtokenizer: Qwen2Tokenizertext_encoder_2: T5EncoderModeltokenizer_2: ByT5Tokenizertransformer: HunyuanImageTransformer2DModelguider: AdaptiveProjectedMixGuidance | None = Noneocr_guider: AdaptiveProjectedMixGuidance | None = None )

パラメータ

  • transformer (HunyuanImageTransformer2DModel) — エンコードされた画像の潜在変数からノイズを除去するための、条件付き Transformer (MMDiT) アーキテクチャ。
  • scheduler (FlowMatchEulerDiscreteScheduler) — transformer と組み合わせて、エンコードされた画像の潜在変数からノイズを除去するために使用するスケジューラ。
  • vae (AutoencoderKLHunyuanImage) — 画像を潜在表現にエンコードし、潜在表現からデコードするための Variational Auto-Encoder (VAE) モデル。
  • text_encoder (Qwen2.5-VL-7B-Instruct) — 具体的には、Qwen2.5-VL-7B-Instruct の Qwen2.5-VL-7B-Instruct バリアントです。
  • tokenizer (Qwen2Tokenizer) — [Qwen2Tokenizer] クラスのトークナイザー。
  • text_encoder_2 (T5EncoderModel) — T5EncoderModel のバリアント。
  • tokenizer_2 (ByT5Tokenizer) — [ByT5Tokenizer] クラスのトークナイザー
  • guider (AdaptiveProjectedMixGuidance) — 画像生成をガイドするために使用される[AdaptiveProjectedMixGuidance]。
  • ocr_guider (AdaptiveProjectedMixGuidance、任意) — テキストレンダリングが必要な場合に、画像生成をガイドするために使用する [AdaptiveProjectedMixGuidance]。

テキストから画像を生成するためのHunyuanImageパイプライン。

__call__

< >

( prompt: str | list[str] = Nonenegative_prompt: str | list[str] = Noneheight: int | None = Nonewidth: int | None = Nonenum_inference_steps: int = 50distilled_guidance_scale: float | None = 3.25sigmas: list[float] | None = Nonenum_images_per_prompt: int = 1generator: torch.Generator | list[torch.Generator] | None = Nonelatents: torch.Tensor | None = Noneprompt_embeds: torch.Tensor | None = Noneprompt_embeds_mask: torch.Tensor | None = Nonenegative_prompt_embeds: torch.Tensor | None = Nonenegative_prompt_embeds_mask: torch.Tensor | None = Noneprompt_embeds_2: torch.Tensor | None = Noneprompt_embeds_mask_2: torch.Tensor | None = Nonenegative_prompt_embeds_2: torch.Tensor | None = Nonenegative_prompt_embeds_mask_2: torch.Tensor | None = Noneoutput_type: str | None = 'pil'return_dict: bool = Trueattention_kwargs: dict[str, Any] | None = Nonecallback_on_step_end: Callable[[int, int], None] | None = Nonecallback_on_step_end_tensor_inputs: list[str] = ['latents'] ) → ~pipelines.hunyuan_image.HunyuanImagePipelineOutput or tuple

パラメータ

  • prompt (str または list[str]、省略可) — 画像生成をガイドするためのプロンプトです。未定義の場合、代わりに prompt_embeds を渡す必要があります。
  • negative_prompt (str または list[str]、省略可) — 画像生成をガイドしないプロンプトです。定義されておらず、negative_prompt_embeds も提供されていない場合、空のネガティブプロンプトが使用されます。ガイダンスを使用していない場合は無視されます。
  • height (int、任意、デフォルトは self.unet.config.sample_size * self.vae_scale_factor) — 生成される画像のピクセル単位の縦幅です。最適な結果を得るため、デフォルトでは 1024 に設定されています。
  • width (int、任意、デフォルトは self.unet.config.sample_size * self.vae_scale_factor) — 生成される画像の幅(ピクセル単位)です。最適な結果を得るため、デフォルトでは 1024 に設定されています。
  • num_inference_steps (int、任意、デフォルト値は 50)— デノイジングのステップ数です。デノイジングのステップ数を増やすと、推論速度が遅くなる代わりに、通常はより高品質な画像が得られます。
  • sigmas (list[float]、任意) — set_timesteps メソッドで sigmas 引数を受け付けるスケジューラーにおいて、デノイジングプロセスに使用するカスタムのシグマです。定義されていない場合、num_inference_steps が渡された際のデフォルトの動作が使用されます。
  • distilled_guidance_scale (float, 任意、デフォルトは None) — guidance distilled モデル用の guidance scale の値です。従来の classifier-free guidance では、推論時にノイズ予測の rescaling を通じて guidance scale が適用されますが、guidance distilled モデルでは、forward pass 時に guidance scale を直接入力パラメータとして受け取ります。distilled_guidance_scale > 1 に設定することで guidance が有効になります。guidance scale を高くすると、prompt と密接に関連する画像の生成が促されますが、通常は画像品質の低下を伴います。guidance distilled モデルでは、このパラメータは必須です。非 distilled モデルでは、このパラメータは無視されます。
  • num_images_per_prompt (int、任意、デフォルトは 1) — プロンプトごとに生成する画像の数。
  • generator (torch.Generator または list[torch.Generator]、省略可) — 生成を決定論的にするためのtorch ジェネレーター1つまたはリスト。
  • latents (torch.Tensor, 任意) — 画像生成の入力として使用する、ガウス分布からサンプリングされた事前生成されたノイズ付き潜在変数。異なるプロンプトで同じ生成を調整するために使用できます。指定されない場合、指定されたランダムgeneratorを使用してサンプリングを行い、潜在変数テンソルが生成されます。
  • prompt_embeds (torch.Tensor, 任意) — 事前に生成されたテキスト埋め込み。テキスト入力の調整、例えばプロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、prompt 入力引数からテキスト埋め込みが生成されます。
  • prompt_embeds_mask (torch.Tensor, 任意) — 事前に生成されたテキスト埋め込みのマスク。テキスト入力の調整、例えばプロンプトの重み付けなどに簡単に使用できます。 指定されない場合、prompt 入力引数からテキスト埋め込みのマスクが生成されます。
  • prompt_embeds_2 (torch.Tensor, 任意) — ocr 用の事前生成されたテキスト埋め込みです。テキスト入力の調整、例えばプロンプトの重み付けなどを簡単に実行できます。指定されない場合、prompt 入力引数から ocr 用のテキスト埋め込みが生成されます。
  • prompt_embeds_mask_2 (torch.Tensor, 任意) — ocr 用の事前生成されたテキスト埋め込みマスクです。テキスト入力の調整、例えばプロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、prompt 入力引数から ocr 用のテキスト埋め込みマスクが生成されます。
  • negative_prompt_embeds (torch.Tensor, 任意) — 事前に生成されたネガティブなテキスト埋め込みです。テキスト入力の調整、例えばプロンプトの重み付けなどを簡単に実行できます。指定されない場合、negative_prompt 入力引数から negative_prompt_embeds が生成されます。
  • negative_prompt_embeds_mask (torch.Tensor, 省略可) — 事前生成されたネガティブテキスト埋め込みのマスクです。例えば、プロンプトの重み付けなど、テキスト入力の調整を簡単に実行するために使用できます。指定されない場合、negative_prompt 入力引数からネガティブテキスト埋め込みのマスクが生成されます。
  • negative_prompt_embeds_2 (torch.Tensor, 任意) — ocr 用の事前生成されたネガティブテキスト埋め込みです。例えば、プロンプトの重み付けなど、テキスト入力の調整を簡単に実行できます。指定されない場合、negative_prompt 入力引数から ocr 用のネガティブテキスト埋め込みが生成されます。
  • negative_prompt_embeds_mask_2 (torch.Tensor, 任意) — ocr 用の事前生成されたネガティブテキスト埋め込みマスクです。テキスト入力の調整、例えばプロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、negative_prompt 入力引数から ocr 用のネガティブテキスト埋め込みマスクが生成されます。
  • output_type (str、任意、デフォルトは "pil") — 画像生成の出力形式です。PIL: PIL.Image.Image または np.array から選択します。
  • return_dict (bool、省略可、デフォルトはTrue) — ~pipelines.qwenimage.QwenImagePipelineOutputを返すか、プレーンなタプルを返すかを指定します。
  • attention_kwargs (dict, 省略可) — 指定された場合、diffusers.models.attention_processor で定義されている self.processor 内の AttentionProcessor に渡される kwargs 辞書です。
  • callback_on_step_end (Callable, 省略可) — 推論中の各デノイジングステップの終了時に呼び出される関数です。この関数は、以下の引数とともに呼び出されます: callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)。 callback_kwargs には、callback_on_step_end_tensor_inputs で指定されたすべてのテンソルのリストが含まれます。
  • callback_on_step_end_tensor_inputs (List, 任意) — callback_on_step_end 関数へのテンソル入力の一覧です。リストで指定されたテンソルは、callback_kwargs 引数として渡されます。パイプラインクラスの ._callback_tensor_inputs 属性にリストされている変数のみを含めることができます。

戻り値

~pipelines.hunyuan_image.HunyuanImagePipelineOutput または tuple

return_dict が True の場合は ~pipelines.hunyuan_image.HunyuanImagePipelineOutput、それ以外の場合は tuple を返します。タプルを返す場合、最初の要素は生成された画像のリストです。

生成用のパイプラインを呼び出したときに実行される関数。

例:

>>> import torch
>>> from diffusers import HunyuanImagePipeline

>>> pipe = HunyuanImagePipeline.from_pretrained(
...     "hunyuanvideo-community/HunyuanImage-2.1-Diffusers", torch_dtype=torch.bfloat16
... )
>>> pipe.to("cuda")
>>> prompt = "A cat holding a sign that says hello world"
>>> # Depending on the variant being used, the pipeline call will slightly vary.
>>> # Refer to the pipeline documentation for more details.
>>> image = pipe(prompt, negative_prompt="", num_inference_steps=50).images[0]
>>> image.save("hunyuanimage.png")

encode_prompt

< >

( prompt: str | list[str]device: torch.device | None = Nonebatch_size: int = 1num_images_per_prompt: int = 1prompt_embeds: torch.Tensor | None = Noneprompt_embeds_mask: torch.Tensor | None = Noneprompt_embeds_2: torch.Tensor | None = Noneprompt_embeds_mask_2: torch.Tensor | None = None )

パラメータ

  • prompt (str または list[str]、省略可能) — エンコードするプロンプト
  • device — (torch.device): torch デバイス
  • batch_size (int) — プロンプトのバッチサイズ。デフォルト値は 1 です。
  • num_images_per_prompt (int) — 1つのプロンプトに対して生成する画像の数
  • prompt_embeds (torch.Tensor, 任意) — 事前に生成されたテキスト埋め込みです。指定されない場合、prompt 入力引数からテキスト埋め込みが生成されます。
  • prompt_embeds_mask (torch.Tensor, 任意) — 事前に生成されたテキストマスクです。指定されない場合、prompt 入力引数からテキストマスクが生成されます。
  • prompt_embeds_2 (torch.Tensor, 任意) — ByT5 によって事前生成されたグリフテキスト埋め込みです。指定されない場合、prompt 入力引数を用いて self.tokenizer_2 および self.text_encoder_2 で生成されます。
  • prompt_embeds_mask_2 (torch.Tensor, 任意) — ByT5 によって事前生成されたグリフテキストマスクです。指定されない場合、prompt 入力引数を用いて self.tokenizer_2 および self.text_encoder_2 で生成されます。

HunyuanImageRefinerPipeline

class diffusers.HunyuanImageRefinerPipeline

< >

( scheduler: FlowMatchEulerDiscreteSchedulervae: AutoencoderKLHunyuanImageRefinertext_encoder: Qwen2_5_VLForConditionalGenerationtokenizer: Qwen2Tokenizertransformer: HunyuanImageTransformer2DModelguider: AdaptiveProjectedMixGuidance | None = None )

パラメータ

  • transformer (HunyuanImageTransformer2DModel) — エンコードされた画像の潜在変数からノイズを除去するための、条件付き Transformer (MMDiT) アーキテクチャ。
  • scheduler (FlowMatchEulerDiscreteScheduler) — transformer と組み合わせて、エンコードされた画像の潜在変数からノイズを除去するために使用するスケジューラ。
  • vae (AutoencoderKLHunyuanImageRefiner) — 画像を潜在表現にエンコードし、潜在表現からデコードするための変分オートエンコーダ(VAE)モデル。
  • text_encoder (Qwen2.5-VL-7B-Instruct) — 具体的には、Qwen2.5-VL-7B-Instruct の Qwen2.5-VL-7B-Instruct バリアントです。
  • tokenizer (Qwen2Tokenizer) — [Qwen2Tokenizer] クラスのトークナイザー。

テキストから画像を生成するためのHunyuanImageパイプライン。

__call__

< >

( prompt: str | list[str] = Nonenegative_prompt: str | list[str] = Nonedistilled_guidance_scale: float | None = 3.25image: PipelineImageInput | None = Noneheight: int | None = Nonewidth: int | None = Nonenum_inference_steps: int = 4sigmas: list[float] | None = Nonenum_images_per_prompt: int = 1generator: torch.Generator | list[torch.Generator] | None = Nonelatents: torch.Tensor | None = Noneprompt_embeds: torch.Tensor | None = Noneprompt_embeds_mask: torch.Tensor | None = Nonenegative_prompt_embeds: torch.Tensor | None = Nonenegative_prompt_embeds_mask: torch.Tensor | None = Noneoutput_type: str | None = 'pil'return_dict: bool = Trueattention_kwargs: dict[str, Any] | None = Nonecallback_on_step_end: Callable[[int, int], None] | None = Nonecallback_on_step_end_tensor_inputs: list[str] = ['latents'] ) → ~pipelines.hunyuan_image.HunyuanImagePipelineOutput or tuple

パラメータ

  • prompt (str または list[str]、省略可) — 画像生成をガイドするためのプロンプトです。未定義の場合、代わりに prompt_embeds を渡す必要があります。
  • negative_prompt (str または list[str]、省略可) — 画像生成をガイドしないプロンプトです。定義されていない場合、空のネガティブプロンプトが使用されます。ガイダンスを使用していない場合は無視されます。
  • distilled_guidance_scale (float, 任意、デフォルトは None) — guidance distilled モデル用の guidance scale の値です。従来の classifier-free guidance では、推論時にノイズ予測の rescaling を通じて guidance scale が適用されますが、guidance distilled モデルでは、forward pass 時に guidance scale を直接入力パラメータとして受け取ります。distilled_guidance_scale > 1 に設定することで guidance が有効になります。guidance scale を高くすると、prompt と密接に関連する画像の生成が促されますが、通常は画像品質の低下を伴います。guidance distilled モデルでは、このパラメータは必須です。非 distilled モデルでは、このパラメータは無視されます。
  • image (PipelineImageInput, 任意) — 精錬する対象の入力画像。
  • num_images_per_prompt (int、任意、デフォルトは 1) —
  • height (int、任意、デフォルトは self.unet.config.sample_size * self.vae_scale_factor) — 生成される画像のピクセル単位の縦幅です。最適な結果を得るため、デフォルトでは 1024 に設定されています。
  • width (int、任意、デフォルトは self.unet.config.sample_size * self.vae_scale_factor) — 生成される画像の幅(ピクセル単位)です。最適な結果を得るため、デフォルトでは 1024 に設定されています。
  • num_inference_steps (int、任意、デフォルト値は 50)— デノイジングのステップ数です。デノイジングのステップ数を増やすと、推論速度が遅くなる代わりに、通常はより高品質な画像が得られます。
  • sigmas (list[float]、任意) — set_timesteps メソッドで sigmas 引数を受け付けるスケジューラーにおいて、デノイジングプロセスに使用するカスタムのシグマです。定義されていない場合、num_inference_steps が渡された際のデフォルトの動作が使用されます。
  • num_images_per_prompt (int、任意、デフォルトは 1) — プロンプトごとに生成する画像の数。
  • generator (torch.Generator または list[torch.Generator]、省略可) — 生成を決定論的にするためのtorch ジェネレーター1つまたはリスト。
  • latents (torch.Tensor, 任意) — 画像生成の入力として使用する、ガウス分布からサンプリングされた事前生成されたノイズ付き潜在変数。異なるプロンプトで同じ生成を調整するために使用できます。指定されない場合、指定されたランダムgeneratorを使用してサンプリングを行い、潜在変数テンソルが生成されます。
  • prompt_embeds (torch.Tensor, 任意) — 事前に生成されたテキスト埋め込み。テキスト入力の調整、例えばプロンプトの重み付けなどを容易に行うために使用できます。指定されない場合、prompt 入力引数からテキスト埋め込みが生成されます。
  • prompt_embeds_mask (torch.Tensor, 任意) — prompt_embeds 用のアテンションマスクです。
  • negative_prompt_embeds (torch.Tensor, 任意) — 事前に生成されたネガティブなテキスト埋め込みです。テキスト入力の調整、例えばプロンプトの重み付けなどを簡単に実行できます。指定されない場合、negative_prompt 入力引数から negative_prompt_embeds が生成されます。
  • negative_prompt_embeds_mask (torch.Tensor, 任意) — negative_prompt_embeds 用のアテンションマスクです。
  • output_type (str、任意、デフォルトは "pil") — 画像生成の出力形式です。PIL: PIL.Image.Image または np.array から選択します。
  • return_dict (bool、省略可、デフォルトはTrue) — ~pipelines.qwenimage.QwenImagePipelineOutputを返すか、プレーンなタプルを返すかを指定します。
  • attention_kwargs (dict, 省略可) — 指定された場合、diffusers.models.attention_processor で定義されている self.processor 内の AttentionProcessor に渡される kwargs 辞書です。
  • callback_on_step_end (Callable, 省略可) — 推論中の各デノイジングステップの終了時に呼び出される関数です。この関数は、以下の引数とともに呼び出されます: callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)。 callback_kwargs には、callback_on_step_end_tensor_inputs で指定されたすべてのテンソルのリストが含まれます。
  • callback_on_step_end_tensor_inputs (List, 任意) — callback_on_step_end 関数へのテンソル入力の一覧です。リストで指定されたテンソルは、callback_kwargs 引数として渡されます。パイプラインクラスの ._callback_tensor_inputs 属性にリストされている変数のみを含めることができます。

戻り値

~pipelines.hunyuan_image.HunyuanImagePipelineOutput または tuple

return_dict が True の場合は ~pipelines.hunyuan_image.HunyuanImagePipelineOutput、それ以外の場合は tuple を返します。タプルを返す場合、最初の要素は生成された画像のリストです。

生成用のパイプラインを呼び出したときに実行される関数。

例:

>>> import torch
>>> from diffusers import HunyuanImageRefinerPipeline

>>> pipe = HunyuanImageRefinerPipeline.from_pretrained(
...     "hunyuanvideo-community/HunyuanImage-2.1-Refiner-Diffusers", torch_dtype=torch.bfloat16
... )
>>> pipe.to("cuda")
>>> prompt = "A cat holding a sign that says hello world"
>>> image = load_image("path/to/image.png")
>>> # Depending on the variant being used, the pipeline call will slightly vary.
>>> # Refer to the pipeline documentation for more details.
>>> image = pipe(prompt, image=image, num_inference_steps=4).images[0]
>>> image.save("hunyuanimage.png")

encode_prompt

< >

( prompt: str | list[str] | None = Nonedevice: torch.device | None = Nonebatch_size: int = 1num_images_per_prompt: int = 1prompt_embeds: torch.Tensor | None = Noneprompt_embeds_mask: torch.Tensor | None = None )

パラメータ

  • prompt (str または list[str]、省略可能) — エンコードするプロンプト
  • device — (torch.device): torch デバイス
  • batch_size (int) — プロンプトのバッチサイズ。デフォルト値は 1 です。
  • num_images_per_prompt (int) — 1つのプロンプトに対して生成する画像の数
  • prompt_embeds (torch.Tensor, 任意) — 事前に生成されたテキスト埋め込みです。指定されない場合、prompt 入力引数からテキスト埋め込みが生成されます。
  • prompt_embeds_mask (torch.Tensor, 任意) — 事前に生成されたテキストマスクです。指定されない場合、prompt 入力引数からテキストマスクが生成されます。
  • prompt_embeds_2 (torch.Tensor, 任意) — ByT5 によって事前生成されたグリフテキスト埋め込みです。指定されない場合、prompt 入力引数を用いて self.tokenizer_2 および self.text_encoder_2 で生成されます。
  • prompt_embeds_mask_2 (torch.Tensor, 任意) — ByT5 によって事前生成されたグリフテキストマスクです。指定されない場合、prompt 入力引数を用いて self.tokenizer_2 および self.text_encoder_2 で生成されます。

HunyuanImagePipelineOutput

class diffusers.pipelines.hunyuan_image.pipeline_output.HunyuanImagePipelineOutput

< >

( images: list )

パラメータ

  • images (list[PIL.Image.Image] または np.ndarray) — batch_size 個のノイズ除去済み PIL 画像のリスト、または形状が (batch_size, height, width, num_channels) の numpy 配列。PIL 画像または numpy 配列は、拡散パイプラインによってノイズ除去された画像を表します。

HunyuanImage パイプライン用の出力クラスです。

Update on GitHub