Buckets:
| # Kandinsky 5.0 Görsel | |
| [Kandinsky 5.0](https://arxiv.org/abs/2511.14993), Video ve Image üretimi için bir difüzyon modeli ailesidir. | |
| Kandinsky 5.0 Image Lite, hafif bir görüntü üretim modelidir (6B parametre). | |
| Model, birkaç temel yenilik sunar: | |
| - Daha iyi eğitim kararlılığı için **Flow Matching** ile **Latent diffusion pipeline** | |
| - Metin gömme vektörlerine çapraz dikkat (cross-attention) uygulayan **Diffusion Transformer (DiT)** ana üretken omurga olarak | |
| - Kapsamlı metin anlama için **Qwen2.5-VL** ve **CLIP** kullanılarak çift metin kodlama | |
| - Verimli görüntü kodlama ve çözümlüleme için **Flux VAE** | |
| Orijinal kod tabanı [kandinskylab/Kandinsky-5](https://github.com/kandinskylab/Kandinsky-5) adresinde bulunabilir. | |
| > [!TIP] | |
| > Metinten videoya üretim için resmi model kontrol noktalarını, ön eğitilmiş, SFT, no-CFG ve damıtılmış varyantları dahil olmak üzere, Hub'daki [Kandinsky Lab](https://huggingface.co/kandinskylab) kuruluşunu inceleyin. | |
| ## Mevcut Modeller | |
| Kandinsky 5.0 Image Lite: | |
| | model_id | Açıklama | Kullanım Senaryoları | | |
| |------------|-------------|-----------| | |
| | [**kandinskylab/Kandinsky-5.0-T2I-Lite-sft-Diffusers**](https://huggingface.co/kandinskylab/Kandinsky-5.0-T2I-Lite-sft-Diffusers) | 6B görsel Gözetimli İnce Ayarlanmış model | En yüksek üretim kalitesi | | |
| | [**kandinskylab/Kandinsky-5.0-I2I-Lite-sft-Diffusers**](https://huggingface.co/kandinskylab/Kandinsky-5.0-I2I-Lite-sft-Diffusers) | 6B görüntü düzenleme Gözetimli İnce Ayarlı model | En yüksek üretim kalitesi | | |
| | [**kandinskylab/Kandinsky-5.0-T2I-Lite-pretrain-Diffusers**](https://huggingface.co/kandinskylab/Kandinsky-5.0-T2I-Lite-pretrain-Diffusers) | 6B görüntü tabanlı ön eğitilmiş model | Araştırma ve ince ayar | | |
| | [**kandinskylab/Kandinsky-5.0-I2I-Lite-pretrain-Diffusers**](https://huggingface.co/kandinskylab/Kandinsky-5.0-I2I-Lite-pretrain-Diffusers) | 6B görüntü düzenleme taban ön eğitilmiş modeli | Araştırma ve ince ayar | | |
| ## Kullanım Örnekleri | |
| ### Temel Metinden Görsele Üretim | |
| ```python | |
| import torch | |
| from diffusers import Kandinsky5T2IPipeline | |
| # Load the pipeline | |
| model_id = "kandinskylab/Kandinsky-5.0-T2I-Lite-sft-Diffusers" | |
| pipe = Kandinsky5T2IPipeline.from_pretrained(model_id) | |
| _ = pipe.to(device='cuda',dtype=torch.bfloat16) # or "mps", "xpu", "cpu" | |
| # Generate image | |
| prompt = "A fluffy, expressive cat wearing a bright red hat with a soft, slightly textured fabric. The hat should look cozy and well-fitted on the cat’s head. On the front of the hat, add clean, bold white text that reads “SWEET”, clearly visible and neatly centered. Ensure the overall lighting highlights the hat’s color and the cat’s fur details." | |
| output = pipe( | |
| prompt=prompt, | |
| negative_prompt="", | |
| height=1024, | |
| width=1024, | |
| num_inference_steps=50, | |
| guidance_scale=3.5, | |
| ).image[0] | |
| ``` | |
| ### Temel Görselden Görsel Üretimi | |
| ```python | |
| import torch | |
| from diffusers import Kandinsky5I2IPipeline | |
| from diffusers.utils import load_image | |
| # Load the pipeline | |
| model_id = "kandinskylab/Kandinsky-5.0-I2I-Lite-sft-Diffusers" | |
| pipe = Kandinsky5I2IPipeline.from_pretrained(model_id) | |
| _ = pipe.to(device='cuda',dtype=torch.bfloat16) # or "mps", "xpu", "cpu" | |
| pipe.enable_model_cpu_offload() # <--- Enable CPU offloading for single GPU inference | |
| # Edit the input image | |
| image = load_image( | |
| "https://huggingface.co/kandinsky-community/kandinsky-3/resolve/main/assets/title.jpg?download=true" | |
| ) | |
| prompt = "Change the background from a winter night scene to a bright summer day. Place the character on a sandy beach with clear blue sky, soft sunlight, and gentle waves in the distance. Replace the winter clothing with a light short-sleeved T-shirt (in soft pastel colors) and casual shorts. Ensure the character’s fur reflects warm daylight instead of cold winter tones. Add small beach details such as seashells, footprints in the sand, and a few scattered beach toys nearby. Keep the oranges in the scene, but place them naturally on the sand." | |
| negative_prompt = "" | |
| output = pipe( | |
| image=image, | |
| prompt=prompt, | |
| negative_prompt=negative_prompt, | |
| guidance_scale=3.5, | |
| ).image[0] | |
| ``` | |
| ## Kandinsky5T2IPipeline[[diffusers.Kandinsky5T2IPipeline]] | |
| #### diffusers.Kandinsky5T2IPipeline[[diffusers.Kandinsky5T2IPipeline]] | |
| ```python | |
| diffusers.Kandinsky5T2IPipeline(transformer: Kandinsky5Transformer3DModel, vae: AutoencoderKL, text_encoder: Qwen2_5_VLForConditionalGeneration, tokenizer: Qwen2VLProcessor, text_encoder_2: CLIPTextModel, tokenizer_2: CLIPTokenizer, scheduler: FlowMatchEulerDiscreteScheduler) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py#L120) | |
| **Parametreler:** | |
| transformer (`Kandinsky5Transformer3DModel`) : Kodlanmış görüntü latentlerini gürültüden arındırmak için kullanılan koşullu Transformer. | |
| vae ([AutoencoderKL](/docs/diffusers/main/tr/api/models/autoencoderkl#diffusers.AutoencoderKL)) : Video'ları latent temsillere kodlamak ve bu temsillerden video'ları çözmek için kullanılan [black-forest-labs/FLUX.1-dev (vae)](https://huggingface.co/black-forest-labs/FLUX.1-dev) Varyasyonel Oto-Kodlayıcı Modeli. | |
| text_encoder (`Qwen2_5_VLForConditionalGeneration`) : Donmuş metin kodlayıcı [Qwen2.5-VL](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct). | |
| tokenizer (`AutoProcessor`) : Qwen2.5-VL için Tokenizer. | |
| text_encoder_2 (`CLIPTextModel`) : Donmuş [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), özellikle [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) varyantı. | |
| tokenizer_2 (`CLIPTokenizer`) : CLIP için tokenizer. | |
| scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı. | |
| Kandinsky 5.0 kullanılarak metinden görüntüye üretim için Pipeline. | |
| Bu model [DiffusionPipeline](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline) sınıfından devralınmıştır. Tüm pipeline'lar için uygulanan genel yöntemlerin (indirme, kaydetme, belirli bir cihazda çalıştırma vb.) belgelerini üst sınıfın dokümantasyonunda bulabilirsiniz. | |
| #### __call__[[diffusers.Kandinsky5T2IPipeline.__call__]] | |
| ```python | |
| __call__(prompt: str | list[str] = None, negative_prompt: str | list[str] | None = None, height: int = 1024, width: int = 1024, num_inference_steps: int = 50, guidance_scale: float = 3.5, num_images_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None, prompt_embeds_qwen: typing.Optional[torch.Tensor] = None, prompt_embeds_clip: typing.Optional[torch.Tensor] = None, negative_prompt_embeds_qwen: typing.Optional[torch.Tensor] = None, negative_prompt_embeds_clip: typing.Optional[torch.Tensor] = None, prompt_cu_seqlens: typing.Optional[torch.Tensor] = None, negative_prompt_cu_seqlens: typing.Optional[torch.Tensor] = None, output_type: str | None = 'pil', return_dict: bool = True, callback_on_step_end: typing.Optional[typing.Callable[[int, int, NoneType], diffusers.callbacks.PipelineCallback | diffusers.callbacks.MultiPipelineCallbacks]] = None, callback_on_step_end_tensor_inputs: list = ['latents'], max_sequence_length: int = 512) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py#L534) | |
| **Parametreler:** | |
| prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmadıysa bunun yerine `prompt_embeds` geçirin. | |
| negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretim sırasında kaçınılması gereken istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` geçirin. Rehberlik kullanılmadığında (`guidance_scale` < `1`) yok sayılır. | |
| height (`int`, varsayılan `1024`) : Üretilen görüntünün piksel cinsinden yüksekliği. | |
| width (`int`, varsayılan `1024`) : Üretilen görüntünün piksel cinsinden genişliği. | |
| num_inference_steps (`int`, varsayılan `50`) : Gürültü azaltma adım sayısı. | |
| guidance_scale (`float`, varsayılan `5.0`) : Sınıflandırıcı-ücretsiz yönlendirmede (classifier-free guidance) tanımlanan yönlendirme ölçeği. | |
| num_images_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek görsel sayısı. | |
| generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir torch üreteci. | |
| latents (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş gürültülü latentler. | |
| prompt_embeds_qwen (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş Qwen metin gömme değerleri. | |
| prompt_embeds_clip (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş CLIP metin gömme değerleri. | |
| negative_prompt_embeds_qwen (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş Qwen negatif metin gömme değerleri. | |
| negative_prompt_embeds_clip (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş CLIP negatif metin gömme değerleri. | |
| prompt_cu_seqlens (`torch.Tensor`, *isteğe bağlı*) : Qwen olumlu istemi için önceden oluşturulmuş kümülatif dizi uzunlukları. | |
| negative_prompt_cu_seqlens (`torch.Tensor`, *isteğe bağlı*) : Qwen negatif istemi için önceden oluşturulmuş kümülatif dizi uzunlukları. | |
| output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen görüntünün çıktı biçimi. | |
| return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Bir `KandinskyImagePipelineOutput` döndürülecek mi? | |
| callback_on_step_end (`Callable`, `PipelineCallback`, `MultiPipelineCallbacks`, *isteğe bağlı*) : Her gürültü azaltma adımının sonunda çağrılan bir işlev. | |
| callback_on_step_end_tensor_inputs (`List`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. | |
| max_sequence_length (`int`, varsayılan `512`) : Metin kodlama için maksimum dizi uzunluğu. | |
| **Dönüş:** `~KandinskyImagePipelineOutput` veya `tuple` | |
| `return_dict` `True` ise `KandinskyImagePipelineOutput` döndürülür, aksi halde ilk öğesi üretilen görüntülerin listesini içeren bir `tuple` döndürülür. | |
| Metinden görüntüye üretim için pipeline'ın çağrı fonksiyonu. | |
| Örnekler: | |
| ```python | |
| >>> import torch | |
| >>> from diffusers import Kandinsky5T2IPipeline | |
| >>> # Available models: | |
| >>> # kandinskylab/Kandinsky-5.0-T2I-Lite-sft-Diffusers | |
| >>> # kandinskylab/Kandinsky-5.0-T2I-Lite-pretrain-Diffusers | |
| >>> model_id = "kandinskylab/Kandinsky-5.0-T2I-Lite-sft-Diffusers" | |
| >>> pipe = Kandinsky5T2IPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) | |
| >>> pipe = pipe.to("cuda") | |
| >>> prompt = "A cat and a dog baking a cake together in a kitchen." | |
| >>> output = pipe( | |
| ... prompt=prompt, | |
| ... negative_prompt="", | |
| ... height=1024, | |
| ... width=1024, | |
| ... num_inference_steps=50, | |
| ... guidance_scale=3.5, | |
| ... ).frames[0] | |
| ``` | |
| #### check_inputs[[diffusers.Kandinsky5T2IPipeline.check_inputs]] | |
| ```python | |
| check_inputs(prompt, negative_prompt, height, width, prompt_embeds_qwen = None, prompt_embeds_clip = None, negative_prompt_embeds_qwen = None, negative_prompt_embeds_clip = None, prompt_cu_seqlens = None, negative_prompt_cu_seqlens = None, callback_on_step_end_tensor_inputs = None, max_sequence_length = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py#L380) | |
| **Parametreler:** | |
| prompt : Girdi istemi | |
| negative_prompt : Yönlendirme için negatif istem | |
| height : Görüntü yüksekliği | |
| width : Görüntü genişliği | |
| prompt_embeds_qwen : Ön hesaplanmış Qwen istek gömme değerleri | |
| prompt_embeds_clip : Ön hesaplanmış CLIP istem gömme değerleri | |
| negative_prompt_embeds_qwen : Ön hesaplanmış Qwen negatif istem gömme değerleri | |
| negative_prompt_embeds_clip : Ön hesaplanmış CLIP negatif istek gömme değerleri | |
| prompt_cu_seqlens : Qwen olumlu istemi için önceden hesaplanmış kümülatif dizi uzunlukları | |
| negative_prompt_cu_seqlens : Qwen negatif istemi için önceden hesaplanmış kümülatif dizi uzunlukları | |
| callback_on_step_end_tensor_inputs : Geri çağrı girdi tensörleri | |
| **Yükselen:** ``ValueError`` | |
| - ``ValueError`` -- Girdiler geçersizse | |
| Hattın girdi parametrelerini doğrulayın. | |
| #### encode_prompt[[diffusers.Kandinsky5T2IPipeline.encode_prompt]] | |
| ```python | |
| encode_prompt(prompt: str | list[str], num_images_per_prompt: int = 1, max_sequence_length: int = 512, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py#L289) | |
| **Parametreler:** | |
| prompt (`str` veya `list[str]`) : Kodlanacak istem. | |
| num_images_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek görsel sayısı. | |
| max_sequence_length (`int`, *isteğe bağlı*, varsayılan 512) : Metin kodlama için maksimum dizi uzunluğu. 1024'ten küçük olmalıdır | |
| device (`torch.device`, *isteğe bağlı*) : Torch cihazı. | |
| dtype (`torch.dtype`, *isteğe bağlı*) : Torch dtype. | |
| **Dönüş:** tuple[torch.Tensor, torch.Tensor, torch.Tensor] | |
| - Şekli (batch_size * num_images_per_prompt, sequence_length, embedding_dim) olan Qwen metin gömme değerleri | |
| - CLIP havuzlanmış gömme vektörleri, şekli (batch_size * num_images_per_prompt, clip_embedding_dim) | |
| - Qwen gömmelemeleri için kümülatif dizi uzunlukları (`cu_seqlens`), şekli (batch_size * num_images_per_prompt + 1,) | |
| Tek bir istemi (pozitif veya negatif) metin kodlayıcı gizli durumlarına kodlar. | |
| Bu yöntem, hem Qwen2.5-VL hem de CLIP metin kodlayıcılarından gelen gömme (embedding) değerlerini birleştirerek görüntü üretimi için kapsamlı metin temsilleri oluşturur. | |
| #### prepare_latents[[diffusers.Kandinsky5T2IPipeline.prepare_latents]] | |
| ```python | |
| prepare_latents(batch_size: int, num_channels_latents: int = 16, height: int = 1024, width: int = 1024, dtype: typing.Optional[torch.dtype] = None, device: typing.Optional[torch.device] = None, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_t2i.py#L469) | |
| **Parametreler:** | |
| batch_size (int) : Üretilecek görsel sayısı | |
| num_channels_latents (int) : Gizli uzaydaki kanal sayısı | |
| height (int) : Üretilen görüntünün yüksekliği | |
| width (int) : Üretilen görüntünün genişliği | |
| dtype (torch.dtype) : Latentler için veri türü | |
| device (torch.device) : Latent'lerin oluşturulacağı cihaz | |
| generator (torch.Generator) : Rastgele sayı üreteci | |
| latents (torch.Tensor) : Kullanılacak mevcut latentler | |
| **Dönüş:** `torch.Tensor` | |
| Hazırlanmış latent tensör | |
| Metinden görüntüye üretim için başlangıç gizli değişkenlerini hazırlar. | |
| Bu yöntem rastgele gürültü latentleri oluşturur | |
| ## Kandinsky5I2IPipeline[[diffusers.Kandinsky5I2IPipeline]] | |
| #### diffusers.Kandinsky5I2IPipeline[[diffusers.Kandinsky5I2IPipeline]] | |
| ```python | |
| diffusers.Kandinsky5I2IPipeline(transformer: Kandinsky5Transformer3DModel, vae: AutoencoderKL, text_encoder: Qwen2_5_VLForConditionalGeneration, tokenizer: Qwen2VLProcessor, text_encoder_2: CLIPTextModel, tokenizer_2: CLIPTokenizer, scheduler: FlowMatchEulerDiscreteScheduler) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py#L120) | |
| **Parametreler:** | |
| transformer (`Kandinsky5Transformer3DModel`) : Kodlanmış görüntü latentlerini gürültüden arındırmak için kullanılan koşullu Transformer. | |
| vae ([AutoencoderKL](/docs/diffusers/main/tr/api/models/autoencoderkl#diffusers.AutoencoderKL)) : Video'ları latent temsillere kodlamak ve bu temsillerden video'ları çözmek için kullanılan [black-forest-labs/FLUX.1-dev (vae)](https://huggingface.co/black-forest-labs/FLUX.1-dev) Varyasyonel Oto-Kodlayıcı Modeli. | |
| text_encoder (`Qwen2_5_VLForConditionalGeneration`) : Donmuş metin kodlayıcı [Qwen2.5-VL](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct). | |
| tokenizer (`AutoProcessor`) : Qwen2.5-VL için Tokenizer. | |
| text_encoder_2 (`CLIPTextModel`) : Donmuş [CLIP](https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel), özellikle [clip-vit-large-patch14](https://huggingface.co/openai/clip-vit-large-patch14) varyantı. | |
| tokenizer_2 (`CLIPTokenizer`) : CLIP için tokenizer. | |
| scheduler ([FlowMatchEulerDiscreteScheduler](/docs/diffusers/main/tr/api/schedulers/flow_match_euler_discrete#diffusers.FlowMatchEulerDiscreteScheduler)) : Kodlanmış görüntü latentlerini gürültüden arındırmak için `transformer` ile birlikte kullanılacak bir zamanlayıcı. | |
| Kandinsky 5.0 kullanarak görüntüden görüntüye üretim için Pipeline. | |
| Bu model [DiffusionPipeline](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline) sınıfından devralınmıştır. Tüm pipeline'lar için uygulanan genel yöntemlerin (indirme, kaydetme, belirli bir cihazda çalıştırma vb.) belgelerini üst sınıfın dokümantasyonunda bulabilirsiniz. | |
| #### __call__[[diffusers.Kandinsky5I2IPipeline.__call__]] | |
| ```python | |
| __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] = None, negative_prompt: str | list[str] | None = None, height: int | None = None, width: int | None = None, num_inference_steps: int = 50, guidance_scale: float = 3.5, num_images_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None, prompt_embeds_qwen: typing.Optional[torch.Tensor] = None, prompt_embeds_clip: typing.Optional[torch.Tensor] = None, negative_prompt_embeds_qwen: typing.Optional[torch.Tensor] = None, negative_prompt_embeds_clip: typing.Optional[torch.Tensor] = None, prompt_cu_seqlens: typing.Optional[torch.Tensor] = None, negative_prompt_cu_seqlens: typing.Optional[torch.Tensor] = None, output_type: str | None = 'pil', return_dict: bool = True, callback_on_step_end: typing.Optional[typing.Callable[[int, int, NoneType], diffusers.callbacks.PipelineCallback | diffusers.callbacks.MultiPipelineCallbacks]] = None, callback_on_step_end_tensor_inputs: list = ['latents'], max_sequence_length: int = 1024) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py#L567) | |
| **Parametreler:** | |
| image (`PipelineImageInput`) : Üretimi koşullandırmak için girdi olarak kullanılan görüntü. Bir görüntü, görüntü listesi veya `torch.Tensor` olmalıdır. | |
| prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Tanımlanmadıysa bunun yerine `prompt_embeds` geçirin. | |
| negative_prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretim sırasında kaçınılması gereken istem veya istemler. Tanımlanmamışsa bunun yerine `negative_prompt_embeds` geçirin. Rehberlik kullanılmadığında (`guidance_scale` < `1`) yok sayılır. | |
| height (`int`) : Üretilen görüntünün piksel cinsinden yüksekliği. | |
| width (`int`) : Üretilen görüntünün piksel cinsinden genişliği. | |
| num_inference_steps (`int`, varsayılan `50`) : Gürültü azaltma adım sayısı. | |
| guidance_scale (`float`, varsayılan `5.0`) : Sınıflandırıcı-ücretsiz yönlendirmede (classifier-free guidance) tanımlanan yönlendirme ölçeği. | |
| num_images_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek görsel sayısı. | |
| generator (`torch.Generator` veya `list[torch.Generator]`, *isteğe bağlı*) : Üretimi deterministik hale getirmek için bir torch üreteci. | |
| latents (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş gürültülü latentler. | |
| prompt_embeds_qwen (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş Qwen metin gömme değerleri. | |
| prompt_embeds_clip (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş CLIP metin gömme değerleri. | |
| negative_prompt_embeds_qwen (`torch.Tensor`, *isteğe bağlı*) : Önceden oluşturulmuş Qwen negatif metin gömme değerleri. | |
| negative_prompt_embeds_clip (`torch.Tensor`, *isteğe bağlı*) : Ön oluşturulmuş CLIP negatif metin gömme değerleri. | |
| prompt_cu_seqlens (`torch.Tensor`, *isteğe bağlı*) : Qwen olumlu istemi için önceden oluşturulmuş kümülatif dizi uzunlukları. | |
| negative_prompt_cu_seqlens (`torch.Tensor`, *isteğe bağlı*) : Qwen negatif istemi için önceden oluşturulmuş kümülatif dizi uzunlukları. | |
| output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen görüntünün çıktı biçimi. | |
| return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Bir `KandinskyImagePipelineOutput` döndürülecek mi? | |
| callback_on_step_end (`Callable`, `PipelineCallback`, `MultiPipelineCallbacks`, *isteğe bağlı*) : Her gürültü azaltma adımının sonunda çağrılan bir işlev. | |
| callback_on_step_end_tensor_inputs (`List`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. | |
| max_sequence_length (`int`, varsayılan `1024`) : Metin ve görüntü qwen kodlaması için maksimum dizi uzunluğu. 1024'ten küçük olmalıdır | |
| **Dönüş:** `~KandinskyImagePipelineOutput` veya `tuple` | |
| `return_dict` `True` ise `KandinskyImagePipelineOutput` döndürülür, aksi halde ilk öğesi üretilen görüntülerin listesini içeren bir `tuple` döndürülür. | |
| Görselden görsel üretimi için pipeline'ın çağrı fonksiyonu. | |
| Örnekler: | |
| ```python | |
| >>> import torch | |
| >>> from diffusers import Kandinsky5I2IPipeline | |
| >>> # Available models: | |
| >>> # kandinskylab/Kandinsky-5.0-I2I-Lite-sft-Diffusers | |
| >>> # kandinskylab/Kandinsky-5.0-I2I-Lite-pretrain-Diffusers | |
| >>> model_id = "kandinskylab/Kandinsky-5.0-I2I-Lite-sft-Diffusers" | |
| >>> pipe = Kandinsky5I2IPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) | |
| >>> pipe = pipe.to("cuda") | |
| >>> prompt = "A cat and a dog baking a cake together in a kitchen." | |
| >>> output = pipe( | |
| ... prompt=prompt, | |
| ... negative_prompt="", | |
| ... height=1024, | |
| ... width=1024, | |
| ... num_inference_steps=50, | |
| ... guidance_scale=3.5, | |
| ... ).frames[0] | |
| ``` | |
| #### check_inputs[[diffusers.Kandinsky5I2IPipeline.check_inputs]] | |
| ```python | |
| check_inputs(prompt, negative_prompt, image, height, width, prompt_embeds_qwen = None, prompt_embeds_clip = None, negative_prompt_embeds_qwen = None, negative_prompt_embeds_clip = None, prompt_cu_seqlens = None, negative_prompt_cu_seqlens = None, callback_on_step_end_tensor_inputs = None, max_sequence_length = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py#L388) | |
| **Parametreler:** | |
| prompt : Girdi istemi | |
| negative_prompt : Yönlendirme için negatif istem | |
| image : Koşullandırma için giriş görüntüsü | |
| height : Görüntü yüksekliği | |
| width : Görüntü genişliği | |
| prompt_embeds_qwen : Ön hesaplanmış Qwen istek gömme değerleri | |
| prompt_embeds_clip : Ön hesaplanmış CLIP istem gömme değerleri | |
| negative_prompt_embeds_qwen : Ön hesaplanmış Qwen negatif istem gömme değerleri | |
| negative_prompt_embeds_clip : Ön hesaplanmış CLIP negatif istek gömme değerleri | |
| prompt_cu_seqlens : Qwen olumlu istemi için önceden hesaplanmış kümülatif dizi uzunlukları | |
| negative_prompt_cu_seqlens : Qwen negatif istemi için önceden hesaplanmış kümülatif dizi uzunlukları | |
| callback_on_step_end_tensor_inputs : Geri çağrı girdi tensörleri | |
| **Yükselen:** ``ValueError`` | |
| - ``ValueError`` -- Girdiler geçersizse | |
| Hattın girdi parametrelerini doğrulayın. | |
| #### encode_prompt[[diffusers.Kandinsky5I2IPipeline.encode_prompt]] | |
| ```python | |
| encode_prompt(prompt: str | list[str], image: Tensor, num_images_per_prompt: int = 1, max_sequence_length: int = 1024, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py#L295) | |
| **Parametreler:** | |
| prompt (`str` veya `list[str]`) : Kodlanacak istem. | |
| num_images_per_prompt (`int`, *isteğe bağlı*, varsayılan 1) : Her istem için üretilecek görsel sayısı. | |
| max_sequence_length (`int`, *isteğe bağlı*, varsayılan 1024) : Metin kodlama için maksimum dizi uzunluğu. 1024'ten küçük olmalıdır | |
| device (`torch.device`, *isteğe bağlı*) : Torch cihazı. | |
| dtype (`torch.dtype`, *isteğe bağlı*) : Torch dtype. | |
| **Dönüş:** tuple[torch.Tensor, torch.Tensor, torch.Tensor] | |
| - Şekli (batch_size * num_images_per_prompt, sequence_length, embedding_dim) olan Qwen metin gömme değerleri | |
| - CLIP havuzlanmış gömme vektörleri, şekli (batch_size * num_images_per_prompt, clip_embedding_dim) | |
| - Qwen gömmelemeleri için kümülatif dizi uzunlukları (`cu_seqlens`), şekli (batch_size * num_images_per_prompt + 1,) | |
| Tek bir istemi (pozitif veya negatif) metin kodlayıcı gizli durumlarına kodlar. | |
| Bu yöntem, hem Qwen2.5-VL hem de CLIP metin kodlayıcılarından gelen gömme (embedding) değerlerini birleştirerek görüntü üretimi için kapsamlı metin temsilleri oluşturur. | |
| #### prepare_latents[[diffusers.Kandinsky5I2IPipeline.prepare_latents]] | |
| ```python | |
| prepare_latents(image: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]], batch_size: int, num_channels_latents: int = 16, height: int = 1024, width: int = 1024, dtype: typing.Optional[torch.dtype] = None, device: typing.Optional[torch.device] = None, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: typing.Optional[torch.Tensor] = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky5/pipeline_kandinsky_i2i.py#L482) | |
| **Parametreler:** | |
| image (PipelineImageInput) : Üretimi koşullandırmak için girdi görseli | |
| batch_size (int) : Üretilecek görsel sayısı | |
| num_channels_latents (int) : Gizli uzaydaki kanal sayısı | |
| height (int) : Üretilen görüntünün yüksekliği | |
| width (int) : Üretilen görüntünün genişliği | |
| dtype (torch.dtype) : Latentler için veri türü | |
| device (torch.device) : Latent'lerin oluşturulacağı cihaz | |
| generator (torch.Generator) : Rastgele sayı üreteci | |
| latents (torch.Tensor) : Kullanılacak mevcut latentler | |
| **Dönüş:** `torch.Tensor` | |
| Kodlanmış görüntü ile hazırlanmış latent tensör | |
| Görselden görsel üretim için başlangıç gizli değişkenlerini hazırlar. | |
| Bu yöntem, kodlanmış görüntü ile rastgele gürültü latentleri oluşturur, | |
| ## Atıf | |
| ```bibtex | |
| @misc{kandinsky2025, | |
| author = {Alexander Belykh and Alexander Varlamov and Alexey Letunovskiy and Anastasia Aliaskina and Anastasia Maltseva and Anastasiia Kargapoltseva and Andrey Shutkin and Anna Averchenkova and Anna Dmitrienko and Bulat Akhmatov and Denis Dimitrov and Denis Koposov and Denis Parkhomenko and Dmitrii and Ilya Vasiliev and Ivan Kirillov and Julia Agafonova and Kirill Chernyshev and Kormilitsyn Semen and Lev Novitskiy and Maria Kovaleva and Mikhail Mamaev and Mikhailov and Nikita Kiselev and Nikita Osterov and Nikolai Gerasimenko and Nikolai Vaulin and Olga Kim and Olga Vdovchenko and Polina Gavrilova and Polina Mikhailova and Tatiana Nikulina and Viacheslav Vasilev and Vladimir Arkhipkin and Vladimir Korviakov and Vladimir Polovnikov and Yury Kolabushin}, | |
| title = {Kandinsky 5.0: A family of diffusion models for Video & Image generation}, | |
| howpublished = {\url{https://github.com/kandinskylab/Kandinsky-5}}, | |
| year = 2025 | |
| } | |
| ``` | |
Xet Storage Details
- Size:
- 28.2 kB
- Xet hash:
- 3edefd7499481a2aa2b9c5629616ab192ec07616732c939fac0f54bbc6a73c3d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.