Diffusers documentation

ChronoEdit

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

LoRA

ChronoEdit

ChronoEdit: نحو الاستدلال الزمني لتحرير الصور ومحاكاة العالم من NVIDIA وجامعة تورنتو، بقلم Jay Zhangjie Wu وXuanchi Ren وTianchang Shen وTianshi Cao وKai He وYifan Lu وRuiyuan Gao وEnze Xie وShiyi Lan وJose M. Alvarez وJun Gao وSanja Fidler وZian Wang وHuan Ling.

ملخص سريع: يعيد ChronoEdit صياغة تحرير الصور كمهمة لتوليد الفيديو، مستخدماً الصور المدخلة والمعدّلة كإطارات بداية ونهاية للاستفادة من نماذج الفيديو المُدرَّبة مسبقاً مع الحفاظ على الاتساق الزمني. وتُقدّم مرحلة الاستدلال الزمني رموز استدلال لضمان أن تكون التعديلات معقولة فيزيائياً ولتصوير مسار التحرير.

أدت التطورات الأخيرة في النماذج التوليدية الكبيرة إلى تعزيز كبير لكل من تحرير الصور وتوليد الصور ضمن السياق، ومع ذلك لا يزال هناك فجوة حرجة في ضمان الاتساق الفيزيائي، حيث يجب أن تظل الكائنات المحررة متماسكة. وتكتسب هذه القدرة أهمية خاصة للمهام المتعلقة بمحاكاة العالم. في هذه الورقة، نقدم ChronoEdit، وهو إطار يعيد صياغة تحرير الصور على أنه مشكلة توليد فيديو. أولاً، يعامل ChronoEdit الصور المدخلة والمحررة على أنها الإطار الأول والأخير لفيديو، مما يتيح له الاستفادة من نماذج الفيديو التوليدية الكبيرة المدربة مسبقاً التي تلتقط ليس فقط مظهر الكائنات بل أيضاً الفيزياء الضمنية للحركة والتفاعل من خلال الاتساق الزمني المتعلم. ثانياً، يقدم ChronoEdit مرحلة استدلال زمني يقوم فيها صراحةً بأداء التحرير في وقت الاستدلال. في هذا الإعداد، يُزال الضوضاء من الإطار المستهدف بشكل مشترك مع رموز الاستدلال لتخيل مسار تحرير معقول يقيّد مساحة الحلول بالتحويلات الفيزيائية الممكنة. ثم تُسقط رموز الاستدلال بعد بضع خطوات لتجنب التكلفة الحسابية العالية لعرض فيديو كامل. ولتحقق ChronoEdit، نقدم PBench-Edit، وهو معيار جديد لأزواج الصور والأوامر النصية للسياقات التي تتطلب اتساقاً فيزيائياً، ونُظهر أن ChronoEdit يتفوق على الخطوط الأساسية المتقدمة في كل من الدقة البصرية والمصداقية الفيزيائية. صفحة المشروع للكود والنماذج: this https URL.

تم تطوير خط أنابيب ChronoEdit بواسطة فريق ChronoEdit. الكود الأصلي متاح على GitHub، ويمكن العثور على النماذج المُسبقة التدريب في مجموعة nvidia/ChronoEdit على Hugging Face.

النماذج/LoRAs المتاحة:

تحرير الصور

import torch
import numpy as np
from diffusers import AutoencoderKLWan, ChronoEditTransformer3DModel, ChronoEditPipeline
from diffusers.utils import export_to_video, load_image
from transformers import CLIPVisionModel
from PIL import Image

model_id = "nvidia/ChronoEdit-14B-Diffusers"
image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", dtype=torch.float32)
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32)
transformer = ChronoEditTransformer3DModel.from_pretrained(model_id, subfolder="transformer", dtype=torch.bfloat16)
pipe = ChronoEditPipeline.from_pretrained(model_id, image_encoder=image_encoder, transformer=transformer, vae=vae, dtype=torch.bfloat16)
pipe.to("cuda")  # or "mps", "xpu", "cpu"

image = load_image(
    "https://huggingface.co/spaces/nvidia/ChronoEdit/resolve/main/examples/3.png"
)
max_area = 720 * 1280
aspect_ratio = image.height / image.width
mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
print("width", width, "height", height)
image = image.resize((width, height))
prompt = (
    "The user wants to transform the image by adding a small, cute mouse sitting inside the floral teacup, enjoying a spa bath. The mouse should appear relaxed and cheerful, with a tiny white bath towel draped over its head like a turban. It should be positioned comfortably in the cup’s liquid, with gentle steam rising around it to blend with the cozy atmosphere. "
    "The mouse’s pose should be natural—perhaps sitting upright with paws resting lightly on the rim or submerged in the tea. The teacup’s floral design, gold trim, and warm lighting must remain unchanged to preserve the original aesthetic. The steam should softly swirl around the mouse, enhancing the spa-like, whimsical mood."
)

output = pipe(
    image=image,
    prompt=prompt,
    height=height,
    width=width,
    num_frames=5,
    num_inference_steps=50,
    guidance_scale=5.0,
    enable_temporal_reasoning=False,
    num_temporal_reasoning_steps=0,
).frames[0]
Image.fromarray((output[-1] * 255).clip(0, 255).astype("uint8")).save("output.png")

اختياريًا، فعّل الاستدلال الزمني لتحسين الاتساق الفيزيائي:

output = pipe(
    image=image,
    prompt=prompt,
    height=height,
    width=width,
    num_frames=29,
    num_inference_steps=50,
    guidance_scale=5.0,
    enable_temporal_reasoning=True,
    num_temporal_reasoning_steps=50,
).frames[0]
export_to_video(output, "output.mp4", fps=16)
Image.fromarray((output[-1] * 255).clip(0, 255).astype("uint8")).save("output.png")

الاستدلال باستخدام لورا التقطير على 8 خطوات

import torch
import numpy as np
from diffusers import AutoencoderKLWan, ChronoEditTransformer3DModel, ChronoEditPipeline
from diffusers.schedulers import UniPCMultistepScheduler
from diffusers.utils import export_to_video, load_image
from transformers import CLIPVisionModel
from PIL import Image

model_id = "nvidia/ChronoEdit-14B-Diffusers"
image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", dtype=torch.float32)
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32)
transformer = ChronoEditTransformer3DModel.from_pretrained(model_id, subfolder="transformer", dtype=torch.bfloat16)
pipe = ChronoEditPipeline.from_pretrained(model_id, image_encoder=image_encoder, transformer=transformer, vae=vae, dtype=torch.bfloat16)
pipe.load_lora_weights("nvidia/ChronoEdit-14B-Diffusers", weight_name="lora/chronoedit_distill_lora.safetensors", adapter_name="distill")
pipe.fuse_lora(adapter_names=["distill"], lora_scale=1.0)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=2.0)
pipe.to("cuda")  # or "mps", "xpu", "cpu"

image = load_image(
    "https://huggingface.co/spaces/nvidia/ChronoEdit/resolve/main/examples/3.png"
)
max_area = 720 * 1280
aspect_ratio = image.height / image.width
mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
print("width", width, "height", height)
image = image.resize((width, height))
prompt = (
    "The user wants to transform the image by adding a small, cute mouse sitting inside the floral teacup, enjoying a spa bath. The mouse should appear relaxed and cheerful, with a tiny white bath towel draped over its head like a turban. It should be positioned comfortably in the cup’s liquid, with gentle steam rising around it to blend with the cozy atmosphere. "
    "The mouse’s pose should be natural—perhaps sitting upright with paws resting lightly on the rim or submerged in the tea. The teacup’s floral design, gold trim, and warm lighting must remain unchanged to preserve the original aesthetic. The steam should softly swirl around the mouse, enhancing the spa-like, whimsical mood."
)

output = pipe(
    image=image,
    prompt=prompt,
    height=height,
    width=width,
    num_frames=5,
    num_inference_steps=8,
    guidance_scale=1.0,
    enable_temporal_reasoning=False,
    num_temporal_reasoning_steps=0,
).frames[0]
export_to_video(output, "output.mp4", fps=16)
Image.fromarray((output[-1] * 255).clip(0, 255).astype("uint8")).save("output.png")

الاستدلال باستخدام عدة LoRAs

import torch
import numpy as np
from diffusers import AutoencoderKLWan, ChronoEditTransformer3DModel, ChronoEditPipeline
from diffusers.schedulers import UniPCMultistepScheduler
from diffusers.utils import export_to_video, load_image
from transformers import CLIPVisionModel
from PIL import Image

model_id = "nvidia/ChronoEdit-14B-Diffusers"
image_encoder = CLIPVisionModel.from_pretrained(model_id, subfolder="image_encoder", dtype=torch.float32)
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", dtype=torch.float32)
transformer = ChronoEditTransformer3DModel.from_pretrained(model_id, subfolder="transformer", dtype=torch.bfloat16)
pipe = ChronoEditPipeline.from_pretrained(model_id, image_encoder=image_encoder, transformer=transformer, vae=vae, dtype=torch.bfloat16)
pipe.load_lora_weights("nvidia/ChronoEdit-14B-Diffusers-Paint-Brush-Lora", weight_name="paintbrush_lora_diffusers.safetensors", adapter_name="paintbrush")
pipe.load_lora_weights("nvidia/ChronoEdit-14B-Diffusers", weight_name="lora/chronoedit_distill_lora.safetensors", adapter_name="distill")
pipe.fuse_lora(adapter_names=["paintbrush", "distill"], lora_scale=1.0)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=2.0)
pipe.to("cuda")  # or "mps", "xpu", "cpu"

image = load_image(
    "https://raw.githubusercontent.com/nv-tlabs/ChronoEdit/refs/heads/main/assets/images/input_paintbrush.png"
)
max_area = 720 * 1280
aspect_ratio = image.height / image.width
mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
print("width", width, "height", height)
image = image.resize((width, height))
prompt = (
    "Turn the pencil sketch in the image into an actual object that is consistent with the image’s content. The user wants to change the sketch to a crown and a hat."
)

output = pipe(
    image=image,
    prompt=prompt,
    height=height,
    width=width,
    num_frames=5,
    num_inference_steps=8,
    guidance_scale=1.0,
    enable_temporal_reasoning=False,
    num_temporal_reasoning_steps=0,
).frames[0]
export_to_video(output, "output.mp4", fps=16)
Image.fromarray((output[-1] * 255).clip(0, 255).astype("uint8")).save("output_1.png")

ChronoEditPipeline

فئة diffusers.ChronoEditPipeline

< >

( tokenizer: AutoTokenizertext_encoder: UMT5EncoderModelimage_encoder: CLIPVisionModelimage_processor: CLIPImageProcessorPiltransformer: ChronoEditTransformer3DModelvae: AutoencoderKLWanscheduler: FlowMatchEulerDiscreteScheduler )

المعاملات

  • tokenizer (T5Tokenizer) — مُقسِّم من T5، تحديداً النسخة google/umt5-xxl.
  • text_encoder (T5EncoderModel) — T5، وتحديداً النسخة google/umt5-xxl.
  • image_encoder (CLIPVisionModel) — CLIP، وتحديداً النسخة clip-vit-huge-patch14.
  • transformer (WanTransformer3DModel) — نموذج Transformer مشروط لإزالة الضوضاء من المتغيرات الكامنة المدخلة.
  • scheduler (UniPCMultistepScheduler) — جدولة تُستخدم بالاقتران مع transformer لإزالة الضوضاء من كائنات الصورة المُرمّزة.
  • vae (AutoencoderKLWan) — نموذج الترميز التبايني التلقائي (VAE) لتشفير وفك تشفير مقاطع الفيديو إلى تمثيلات كامنة ومنها.

خط أنابيب لتوليد الفيديو من الصور باستخدام Wan.

يرث هذا النموذج من DiffusionPipeline. راجع توثيق الفئة الأصلية لمعرفة الطرق العامة المُنفَّذة لجميع خطوط الأنابيب (التنزيل، الحفظ، التشغيل على جهاز معين، إلخ).

__call__

< >

( image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]]prompt: str | list[str] = Nonenegative_prompt: str | list[str] = Noneheight: int = 480width: int = 832num_frames: int = 81num_inference_steps: int = 50guidance_scale: float = 5.0num_videos_per_prompt: int | None = 1generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = Nonelatents: typing.Optional[torch.Tensor] = Noneprompt_embeds: typing.Optional[torch.Tensor] = Nonenegative_prompt_embeds: typing.Optional[torch.Tensor] = Noneimage_embeds: typing.Optional[torch.Tensor] = Noneoutput_type: str | None = 'np'return_dict: bool = Trueattention_kwargs: dict[str, typing.Any] | None = Nonecallback_on_step_end: typing.Optional[typing.Callable[[int, int, NoneType], diffusers.callbacks.PipelineCallback | diffusers.callbacks.MultiPipelineCallbacks]] = Nonecallback_on_step_end_tensor_inputs: list = ['latents']max_sequence_length: int = 512enable_temporal_reasoning: bool = Falsenum_temporal_reasoning_steps: int = 0 ) → ~ChronoEditPipelineOutput or tuple

المعاملات

  • image (PipelineImageInput) — الصورة المدخلة التي تُشترط عليها عملية التوليد. يجب أن تكون صورة، أو قائمة من الصور، أو torch.Tensor.
  • prompt (str أو list[str]، اختياري) — الموجّه أو الموجّهات التي توجّه توليد الصورة. إذا لم يُعرَّف، يجب تمرير prompt_embeds بدلاً من ذلك.
  • negative_prompt (str أو list[str]، اختياري) — الموجّه أو الموجّهات التي لا ينبغي استخدامها لتوجيه توليد الصورة. إذا لم يُعرَّف، يجب تمرير negative_prompt_embeds بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (أي يتم تجاهله إذا كان guidance_scale أقل من 1).
  • height (int، القيمة الافتراضية 480) — ارتفاع الفيديو المولّد.
  • width (int، القيمة الافتراضية 832) — عرض الفيديو المولّد.
  • num_frames (int، القيمة الافتراضية 81) — عدد الإطارات في الفيديو المولّد.
  • num_inference_steps (int، القيمة الافتراضية 50) — عدد خطوات إزالة الضوضاء. تؤدي زيادة عدد خطوات إزالة الضوضاء عادةً إلى صورة بجودة أعلى على حساب بطء الاستدلال.
  • guidance_scale (float، القيمة الافتراضية 5.0) — مقياس التوجيه كما هو مٌعرَّف في Classifier-Free Diffusion Guidance. يُعرَّف guidance_scale على أنه w في المعادلة 2 من Imagen Paper. يتم تفعيل مقياس التوجيه عن طريق تعيين guidance_scale > 1. كلما زاد مقياس التوجيه، شجّع ذلك على توليد صور مرتبطة ارتباطًا وثيقًا بنص prompt، وعادةً على حساب انخفاض جودة الصورة.
  • num_videos_per_prompt (int، اختياري، القيمة الافتراضية 1) — عدد الصور التي سيتم توليدها لكل موجه.
  • generator (torch.Generator أو list[torch.Generator]، اختياري) — torch.Generator لجعل التوليد حتميًا.
  • latents (torch.Tensor، اختياري) — كائنات latents ضجيجية مُولّدة مسبقًا، مُستخرجة من توزيع غاوسي، تُستخدم كمدخلات لتوليد الصور. يمكن استخدامها لتعديل نفس التوليد باستخدام أوامر مختلفة. إذا لم تُقدَّم، يتم توليد كائن latents عن طريق الاستخراج باستخدام generator العشوائي المُقدَّم.
  • prompt_embeds (torch.Tensor، اختياري) — تضمينات نصية مُولَّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة (مثل وزن الموجهات). إذا لم تُقدَّم، يتم توليد التضمينات النصية من معامل الإدخال prompt.
  • negative_prompt_embeds (torch.Tensor، اختياري) — تضمينات نصية مُولَّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة (وزن الموجه). إذا لم تُقدَّم، يتم توليد التضمينات النصية من معامل الإدخال negative_prompt.
  • image_embeds (torch.Tensor، اختياري) — تضمينات صور مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات الصور بسهولة (مثل ضبط الأوزان). إذا لم تُقدَّم، فسيتم توليد تضمينات الصور من معامل الإدخال image.
  • output_type (str، اختياري، الافتراضي "np") — صيغة مخرجات الصورة المولّدة. اختر بين PIL.Image أو np.array.
  • return_dict (bool، اختياري، القيمة الافتراضية True) — ما إذا كان يجب إرجاع ChronoEditPipelineOutput بدلاً من tuple عادي.
  • attention_kwargs (dict، اختياري) — قاموس kwargs يُمرَّر إلى AttentionProcessor إذا تم تحديده، كما هو معرَّف تحت self.processor في diffusers.models.attention_processor.
  • callback_on_step_end (Callable، PipelineCallback، MultiPipelineCallbacks، اختياري) — دالة أو فئة فرعية من PipelineCallback أو MultiPipelineCallbacks تُستدعى في نهاية كل خطوة إزالة ضوضاء أثناء الاستدلال، مع الحُجج التالية: 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, اختياري) — قائمة مدخلات المصفوفات (tensors) لدالة callback_on_step_end. سيتم تمرير المصفوفات المحددة في القائمة كحجة callback_kwargs. لن تتمكن من تضمين سوى المتغيرات المدرجة في خاصية ._callback_tensor_inputs لفئة خط الأنابيب (pipeline) الخاص بك.
  • max_sequence_length (int، القيمة الافتراضية 512) — الحد الأقصى لطول التسلسل في مُشفِّر النص. إذا كان النص المطروح أطول من هذا الحد، فسيتم اقتطاعه. وإذا كان أقصر، فسيتم ملؤه حتى يصل إلى هذا الطول.
  • enable_temporal_reasoning (bool، اختياري، القيمة الافتراضية False) — ما إذا كان سيتم تفعيل الاستدلال الزمني.
  • num_temporal_reasoning_steps (int، اختياري، القيمة الافتراضية 0) — عدد الخطوات لتفعيل الاستدلال الزمني.

يعيد

~ChronoEditPipelineOutput أو tuple

إذا كان return_dict هو True، يُعاد ChronoEditPipelineOutput، وإلا يُعاد tuple حيث يكون العنصر الأول قائمة بالصور المولّدة والعنصر الثاني قائمة من قيم bool تُشير إلى ما إذا كانت الصورة المولّدة المقابلة تحتوي على محتوى “غير آمن للعمل” (nsfw).

دالة الاستدعاء call لخط الأنابيب pipeline الخاص بالتوليد.

أمثلة:

>>> import torch
>>> import numpy as np
>>> from diffusers import AutoencoderKLWan, ChronoEditTransformer3DModel, ChronoEditPipeline
>>> from diffusers.utils import export_to_video, load_image
>>> from transformers import CLIPVisionModel

>>> # Available models: nvidia/ChronoEdit-14B-Diffusers
>>> model_id = "nvidia/ChronoEdit-14B-Diffusers"
>>> image_encoder = CLIPVisionModel.from_pretrained(
...     model_id, subfolder="image_encoder", torch_dtype=torch.float32
... )
>>> vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
>>> transformer = ChronoEditTransformer3DModel.from_pretrained(
...     model_id, subfolder="transformer", torch_dtype=torch.bfloat16
... )
>>> pipe = ChronoEditPipeline.from_pretrained(
...     model_id, vae=vae, image_encoder=image_encoder, transformer=transformer, torch_dtype=torch.bfloat16
... )
>>> pipe.to("cuda")

>>> image = load_image("https://huggingface.co/spaces/nvidia/ChronoEdit/resolve/main/examples/3.png")
>>> max_area = 720 * 1280
>>> aspect_ratio = image.height / image.width
>>> mod_value = pipe.vae_scale_factor_spatial * pipe.transformer.config.patch_size[1]
>>> height = round(np.sqrt(max_area * aspect_ratio)) // mod_value * mod_value
>>> width = round(np.sqrt(max_area / aspect_ratio)) // mod_value * mod_value
>>> image = image.resize((width, height))
>>> prompt = (
...     "The user wants to transform the image by adding a small, cute mouse sitting inside the floral teacup, enjoying a spa bath. The mouse should appear relaxed and cheerful, with a tiny white bath towel draped over its head like a turban. It should be positioned comfortably in the cup’s liquid, with gentle steam rising around it to blend with the cozy atmosphere. "
...     "The mouse’s pose should be natural—perhaps sitting upright with paws resting lightly on the rim or submerged in the tea. The teacup’s floral design, gold trim, and warm lighting must remain unchanged to preserve the original aesthetic. The steam should softly swirl around the mouse, enhancing the spa-like, whimsical mood."
... )

>>> output = pipe(
...     image=image,
...     prompt=prompt,
...     height=height,
...     width=width,
...     num_frames=5,
...     guidance_scale=5.0,
...     enable_temporal_reasoning=False,
...     num_temporal_reasoning_steps=0,
... ).frames[0]
>>> export_to_video(output, "output.mp4", fps=16)

encode_prompt

< >

( prompt: str | list[str]negative_prompt: str | list[str] | None = Nonedo_classifier_free_guidance: bool = Truenum_videos_per_prompt: int = 1prompt_embeds: typing.Optional[torch.Tensor] = Nonenegative_prompt_embeds: typing.Optional[torch.Tensor] = Nonemax_sequence_length: int = 226device: typing.Optional[torch.device] = Nonedtype: typing.Optional[torch.dtype] = None )

المعاملات

  • prompt (str أو list[str]، اختياري) — الموجّه الذي سيتم ترميزه
  • negative_prompt (str أو list[str]، اختياري) — الموجّه أو الموجّهات التي لا ينبغي استخدامها لتوجيه توليد الصورة. إذا لم يُعرَّف، يجب تمرير negative_prompt_embeds بدلاً من ذلك. يتم تجاهله عند عدم استخدام التوجيه (أي يتم تجاهله إذا كان guidance_scale أقل من 1).
  • do_classifier_free_guidance (bool، اختياري، القيمة الافتراضية True) — ما إذا كان سيتم استخدام classifier free guidance أم لا.
  • num_videos_per_prompt (int، اختياري، القيمة الافتراضية 1) — عدد الفيديوهات التي يجب توليدها لكل موجه. جهاز torch الذي سيتم وضع التضمينات الناتجة عليه
  • prompt_embeds (torch.Tensor، اختياري) — تضمينات نصية مُولَّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، مثلًا وزن الموجه. إذا لم تُقدَّم، فسيتم توليد تضمينات النص من معامل الإدخال prompt.
  • negative_prompt_embeds (torch.Tensor، اختياري) — تضمينات نصية سلبية مُولّدة مسبقًا. يمكن استخدامها لتعديل مدخلات النص بسهولة، مثلًا وزن الموجه. إذا لم تُقدَّم، فسيتم توليد negative_prompt_embeds من معامل الإدخال negative_prompt.
  • device — (torch.device، اختياري): جهاز torch
  • dtype — (torch.dtype، اختياري): نوع بيانات torch

يقوم بتشفير الموجه إلى حالات مخفية لمشفّر النص.

ChronoEditPipelineOutput

فئة diffusers.pipelines.chronoedit.pipeline_output.ChronoEditPipelineOutput

< >

( frames: Tensor )

المعاملات

  • frames (torch.Tensor أو np.ndarray أو قائمة[قائمة[PIL.Image.Image]]) — قائمة من مخرجات الفيديو - يمكن أن تكون قائمة متداخلة بطول batch_size, حيث تحتوي كل قائمة فرعية على سلاسل صور PIL منزوعة الضوضاء بطول num_frames. كما يمكن أن تكون مصفوفة NumPy أو متجه Torch من الشكل (batch_size, num_frames, channels, height, width).

فئة الإخراج لخطوط أنابيب ChronoEdit.

Update on GitHub