Buckets:
| # | |
| # Apache Lisansı, 2.0 Sürümü ("Lisans") altında lisanslanmıştır; | |
| # bu dosyayı, Lisansa uygun olarak kullanabilirsiniz. | |
| # Lisansın bir kopyasını şu adresten edinebilirsiniz | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Uygulanabilir yasa gerektirmedikçe veya yazılı olarak anlaşılmadıkça, yazılım | |
| # Lisans kapsamında dağıtılan, "OLDUĞU GİBİ" esasına göre dağıtılır, | |
| # HİÇBİR TÜR AÇIK VEYA ZIMMİ GARANTİ VEYA ŞART İÇERMEZ. | |
| # İzinleri ve | |
| # Lisans kapsamındaki kısıtlamalar. | |
| --> | |
| # OmniGen | |
| BAAI'den Shitao Xiao, Yueze Wang, Junjie Zhou, Huaying Yuan, Xingrun Xing, Ruiran Yan, Chaofan Li, Shuting Wang, Tiejun Huang ve Zheng Liu tarafından geliştirilen [OmniGen: Unified Image Generation](https://huggingface.co/papers/2409.11340). | |
| Makalenin özeti şudur: | |
| *Büyük Dil Modelleri'nin (LLM) ortaya çıkması, dil üretim görevlerini birleştirmiş ve insan-makine etkileşimini devrim niteliğinde dönüştürmüştür. Ancak görüntü üretimi alanında, tek bir çerçeve içinde çeşitli görevleri ele alabilen birleşik bir model büyük ölçüde keşfedilmemiştir. Bu çalışmada, birleşik görüntü üretimi için yeni bir difüzyon modeli olan OmniGen'i tanıtıyoruz. OmniGen, aşağıdaki özelliklerle karakterize edilir: 1) Birleştirme: OmniGen yalnızca metinden görüntüye üretim yeteneklerini sergilemekle kalmaz, aynı zamanda görüntü düzenleme, nesne odaklı üretim ve görsel koşullu üretim gibi çeşitli aşağı akış görevlerini de doğal olarak destekler. 2) Sadelik: OmniGen'in mimarisi son derece basitleştirilmiştir ve ek eklentilere olan ihtiyacı ortadan kaldırır. Ayrıca, mevcut difüzyon modellerine kıyasla daha kullanıcı dostudur ve ek ara adımlara ihtiyaç duymadan, talimatlar yoluyla karmaşık görevleri uçtan uca tamamlayabilir; bu da görüntü üretim iş akışını büyük ölçüde basitleştirir. 3) Bilgi Transferi: Birleşik bir biçimde öğrenmeden faydalanarak OmniGen, farklı görevler arasında bilgiyi etkili bir şekilde aktarır, görülmemiş görevleri ve alanları yönetir ve yeni yetenekler sergiler. Ayrıca modelin akıl yürütme yeteneklerini ve chain-of-thought mekanizmasının potansiyel uygulamalarını da inceliyoruz. Bu çalışma, genel amaçlı bir görüntü üretim modeli için ilk denemeyi temsil etmektedir ve gelecekteki ilerlemeleri teşvik etmek için kaynaklarımızı https://github.com/VectorSpaceLab/OmniGen adresinde yayınlayacağız.* | |
| > [!TIP] | |
| > Scheduler'lar [kılavuzunu](../../using-diffusers/schedulers) inceleyerek scheduler hızı ve kalitesi arasındaki ödünleşimi nasıl keşfedebileceğinizi öğrenin ve aynı bileşenleri birden fazla pipeline'a nasıl verimli bir şekilde yükleyebileceğinizi öğrenmek için [pipeline'lar arasında bileşenleri yeniden kullanma](../../using-diffusers/loading#reusing-models-in-multiple-pipelines) bölümüne göz atın. | |
| Bu pipeline [staoxiao](https://github.com/staoxiao) tarafından katkı sağlanmıştır. Orijinal kod tabanı [burada](https://github.com/VectorSpaceLab/OmniGen) bulunabilir. Orijinal ağırlıklar [hf.co/shitao](https://huggingface.co/Shitao/OmniGen-v1) altında bulunabilir. | |
| ## Model kontrol noktalarını yükle | |
| Model ağırlıkları Hub'da veya yerel olarak ayrı alt klasörlerde saklanabilir; bu durumda [from_pretrained()](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained) yöntemini kullanmalısınız. | |
| ```python | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| pipe = OmniGenPipeline.from_pretrained("Shitao/OmniGen-v1-diffusers", dtype=torch.bfloat16) | |
| ``` | |
| ## Metinden görüntüye | |
| Metinden görüntüye için bir metin istemi geçirin. Varsayılan olarak OmniGen 1024x1024 boyutunda bir görüntü üretir. Farklı boyutlarda görüntüler üretmek için `height` ve `width` parametrelerini ayarlamayı deneyebilirsiniz. | |
| ```python | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| pipe = OmniGenPipeline.from_pretrained( | |
| "Shitao/OmniGen-v1-diffusers", | |
| dtype=torch.bfloat16 | |
| ) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| prompt = "Realistic photo. A young woman sits on a sofa, holding a book and facing the camera. She wears delicate silver hoop earrings adorned with tiny, sparkling diamonds that catch the light, with her long chestnut hair cascading over her shoulders. Her eyes are focused and gentle, framed by long, dark lashes. She is dressed in a cozy cream sweater, which complements her warm, inviting smile. Behind her, there is a table with a cup of water in a sleek, minimalist blue mug. The background is a serene indoor setting with soft natural light filtering through a window, adorned with tasteful art and flowers, creating a cozy and peaceful ambiance. 4K, HD." | |
| image = pipe( | |
| prompt=prompt, | |
| height=1024, | |
| width=1024, | |
| guidance_scale=3, | |
| generator=torch.Generator(device="cpu").manual_seed(111), | |
| ).images[0] | |
| image.save("output.png") | |
| ``` | |
| ## Görsel düzenleme | |
| OmniGen çok modlu girdileri destekler. Girdi bir görüntü içeriyorsa, görüntüyü temsil etmek için metin istemine `<img><|image_1|></img>` yer tutucusunu eklemeniz gerekir. Düzenlenen görüntünün orijinal görüntüyle aynı boyutta kalması için `use_input_image_size_as_output` seçeneğinin etkinleştirilmesi önerilir. | |
| ```python | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| from diffusers.utils import load_image | |
| pipe = OmniGenPipeline.from_pretrained( | |
| "Shitao/OmniGen-v1-diffusers", | |
| dtype=torch.bfloat16 | |
| ) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| prompt="<img><|image_1|></img> Remove the woman's earrings. Replace the mug with a clear glass filled with sparkling iced cola." | |
| input_images=[load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/t2i_woman_with_book.png")] | |
| image = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| guidance_scale=2, | |
| img_guidance_scale=1.6, | |
| use_input_image_size_as_output=True, | |
| generator=torch.Generator(device="cpu").manual_seed(222) | |
| ).images[0] | |
| image.save("output.png") | |
| ``` | |
| orijinal görüntü | |
| düzenlenmiş görüntü | |
| OmniGen, aşağıdaki örnekte gösterildiği gibi görsel akıl yürütme gibi bazı ilginç özelliklere sahiptir. | |
| ```python | |
| prompt="If the woman is thirsty, what should she take? Find it in the image and highlight it in blue. <img><|image_1|></img>" | |
| input_images=[load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png")] | |
| image = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| guidance_scale=2, | |
| img_guidance_scale=1.6, | |
| use_input_image_size_as_output=True, | |
| generator=torch.Generator(device="cpu").manual_seed(0) | |
| ).images[0] | |
| image.save("output.png") | |
| ``` | |
| ## Kontrol edilebilir üretim | |
| OmniGen, klasik birkaç bilgisayarla görme görevini işleyebilir. Aşağıda gösterildiği gibi OmniGen, girdi görüntülerindeki insan iskeletlerini algılayabilir ve bu, yeni görüntüler üretmek için kontrol koşulları olarak kullanılabilir. | |
| ```python | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| from diffusers.utils import load_image | |
| pipe = OmniGenPipeline.from_pretrained( | |
| "Shitao/OmniGen-v1-diffusers", | |
| dtype=torch.bfloat16 | |
| ) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| prompt="Detect the skeleton of human in this image: <img><|image_1|></img>" | |
| input_images=[load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png")] | |
| image1 = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| guidance_scale=2, | |
| img_guidance_scale=1.6, | |
| use_input_image_size_as_output=True, | |
| generator=torch.Generator(device="cpu").manual_seed(333) | |
| ).images[0] | |
| image1.save("image1.png") | |
| prompt="Generate a new photo using the following picture and text as conditions: <img><|image_1|></img>\n A young boy is sitting on a sofa in the library, holding a book. His hair is neatly combed, and a faint smile plays on his lips, with a few freckles scattered across his cheeks. The library is quiet, with rows of shelves filled with books stretching out behind him." | |
| input_images=[load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/skeletal.png")] | |
| image2 = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| guidance_scale=2, | |
| img_guidance_scale=1.6, | |
| use_input_image_size_as_output=True, | |
| generator=torch.Generator(device="cpu").manual_seed(333) | |
| ).images[0] | |
| image2.save("image2.png") | |
| ``` | |
| orijinal görüntü | |
| algılanan iskelet | |
| iskeletten görüntüye | |
| OmniGen, girdi görsellerindeki ilgili bilgileri doğrudan kullanarak yeni görseller oluşturabilir. | |
| ```python | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| from diffusers.utils import load_image | |
| pipe = OmniGenPipeline.from_pretrained( | |
| "Shitao/OmniGen-v1-diffusers", | |
| dtype=torch.bfloat16 | |
| ) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| prompt="Following the pose of this image <img><|image_1|></img>, generate a new photo: A young boy is sitting on a sofa in the library, holding a book. His hair is neatly combed, and a faint smile plays on his lips, with a few freckles scattered across his cheeks. The library is quiet, with rows of shelves filled with books stretching out behind him." | |
| input_images=[load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/edit.png")] | |
| image = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| guidance_scale=2, | |
| img_guidance_scale=1.6, | |
| use_input_image_size_as_output=True, | |
| generator=torch.Generator(device="cpu").manual_seed(0) | |
| ).images[0] | |
| image.save("output.png") | |
| ``` | |
| oluşturulan görsel | |
| ## Kimlik ve nesne koruma | |
| OmniGen, girdi görselindeki kişiler ve nesneler temel alınarak birden fazla görsel üretebilir ve aynı anda birden fazla görsel girdisini destekler. Ayrıca OmniGen, birden fazla nesne içeren bir görselden, talimatlara göre istenen nesneleri çıkarabilir. | |
| ```python | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| from diffusers.utils import load_image | |
| pipe = OmniGenPipeline.from_pretrained( | |
| "Shitao/OmniGen-v1-diffusers", | |
| dtype=torch.bfloat16 | |
| ) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| prompt="A man and a woman are sitting at a classroom desk. The man is the man with yellow hair in <img><|image_1|></img>. The woman is the woman on the left of <img><|image_2|></img>" | |
| input_image_1 = load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/3.png") | |
| input_image_2 = load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/4.png") | |
| input_images=[input_image_1, input_image_2] | |
| image = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| height=1024, | |
| width=1024, | |
| guidance_scale=2.5, | |
| img_guidance_scale=1.6, | |
| generator=torch.Generator(device="cpu").manual_seed(666) | |
| ).images[0] | |
| image.save("output.png") | |
| ``` | |
| input_image_1 | |
| input_image_2 | |
| oluşturulan görsel | |
| ```py | |
| import torch | |
| from diffusers import OmniGenPipeline | |
| from diffusers.utils import load_image | |
| pipe = OmniGenPipeline.from_pretrained( | |
| "Shitao/OmniGen-v1-diffusers", | |
| dtype=torch.bfloat16 | |
| ) | |
| pipe.to("cuda") # or "mps", "xpu", "cpu" | |
| prompt="A woman is walking down the street, wearing a white long-sleeve blouse with lace details on the sleeves, paired with a blue pleated skirt. The woman is <img><|image_1|></img>. The long-sleeve blouse and a pleated skirt are <img><|image_2|></img>." | |
| input_image_1 = load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/emma.jpeg") | |
| input_image_2 = load_image("https://raw.githubusercontent.com/VectorSpaceLab/OmniGen/main/imgs/docs_img/dress.jpg") | |
| input_images=[input_image_1, input_image_2] | |
| image = pipe( | |
| prompt=prompt, | |
| input_images=input_images, | |
| height=1024, | |
| width=1024, | |
| guidance_scale=2.5, | |
| img_guidance_scale=1.6, | |
| generator=torch.Generator(device="cpu").manual_seed(666) | |
| ).images[0] | |
| image.save("output.png") | |
| ``` | |
| kişi görseli | |
| giysi görseli | |
| oluşturulan görsel | |
| ## Birden fazla görüntü kullanırken optimizasyon | |
| Metinden görüntüye görevinde OmniGen, minimal bellek ve zaman maliyeti gerektirir (A800 GPU üzerinde 1024x1024 boyutunda bir görüntü için 9GB bellek ve 31 saniye). Ancak girdi görüntüleri kullanıldığında hesaplama maliyeti artar. | |
| Birden fazla görüntü kullanırken hesaplama maliyetlerini azaltmanıza yardımcı olacak bazı yönergeler aşağıda verilmiştir. Deneyler, iki giriş görüntüsüyle A800 GPU üzerinde gerçekleştirilmiştir. | |
| Diğer pipeline'lar gibi, modeli dışa aktararak bellek kullanımını azaltabilirsiniz: `pipe.enable_model_cpu_offload()` veya `pipe.enable_sequential_cpu_offload() `. OmniGen'de, `max_input_image_size` değerini azaltarak hesaplama yükünü de düşürebilirsiniz. Farklı görüntü boyutları için bellek tüketimi aşağıdaki tabloda gösterilmektedir: | |
| | Yöntem | Bellek Kullanımı | | |
| |---------------------------|--------------| | |
| | max_input_image_size=1024 | 40GB | | |
| | max_input_image_size=512 | 17GB | | |
| | max_input_image_size=256 | 14GB | | |
| ## OmniGenPipeline[[diffusers.OmniGenPipeline]] | |
| #### diffusers.OmniGenPipeline[[diffusers.OmniGenPipeline]] | |
| ```python | |
| diffusers.OmniGenPipeline(transformer: OmniGenTransformer2DModel, scheduler: FlowMatchEulerDiscreteScheduler, vae: AutoencoderKL, tokenizer: LlamaTokenizer) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L119) | |
| **Parametreler:** | |
| transformer ([OmniGenTransformer2DModel](/docs/diffusers/main/tr/api/models/omnigen_transformer#diffusers.OmniGenTransformer2DModel)) : OmniGen için otoregresif Transformer mimarisi. | |
| 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ı. | |
| vae ([AutoencoderKL](/docs/diffusers/main/tr/api/models/autoencoderkl#diffusers.AutoencoderKL)) : Görüntüleri gizil (latent) temsillere kodlamak ve bu temsillerden görüntülere çözmek için kullanılan Varyasyonel Oto-Kodlayıcı (VAE) Modeli. | |
| tokenizer (`LlamaTokenizer`) : [LlamaTokenizer](https://huggingface.co/docs/transformers/main/model_doc/llama#transformers.LlamaTokenizer) sınıfının metin belirteçleyicisi. | |
| Çok modaldan görüntüye üretim için OmniGen hattı. | |
| Referans: https://huggingface.co/papers/2409.11340 | |
| #### __call__[[diffusers.OmniGenPipeline.__call__]] | |
| ```python | |
| __call__(prompt: str | list[str], input_images: typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor], list[typing.Union[PIL.Image.Image, numpy.ndarray, torch.Tensor, list[PIL.Image.Image], list[numpy.ndarray], list[torch.Tensor]]]] = None, height: int | None = None, width: int | None = None, num_inference_steps: int = 50, max_input_image_size: int = 1024, timesteps: list = None, guidance_scale: float = 2.5, img_guidance_scale: float = 1.6, use_input_image_size_as_output: bool = False, num_images_per_prompt: int | None = 1, generator: typing.Union[torch.Generator, list[torch.Generator], NoneType] = None, latents: 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]] = None, callback_on_step_end_tensor_inputs: list = ['latents']) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L275) | |
| **Parametreler:** | |
| prompt (`str` veya `list[str]`, *isteğe bağlı*) : Görsel üretimi yönlendirmek için istem veya istemler. Girdi görseller içeriyorsa, i. görsellerin konumunu belirtmek için isteme `<img><|image_i|></img>` yer tutucularını eklemek gerekir. | |
| input_images (`PipelineImageInput` veya `list[PipelineImageInput]`, *isteğe bağlı*) : Girdi görsellerinin listesi. Prompt içindeki "<|image_i|>" ifadesini, listedeki i. görselle değiştireceğiz. | |
| height (`int`, *isteğe bağlı*, varsayılan olarak self.unet.config.sample_size * self.vae_scale_factor) : Üretilen görüntünün piksel cinsinden yüksekliği. En iyi sonuçlar için varsayılan olarak 1024 olarak ayarlanır. | |
| width (`int`, *isteğe bağlı*, varsayılan olarak self.unet.config.sample_size * self.vae_scale_factor) : Üretilen görüntünün piksel cinsinden genişliği. En iyi sonuçlar için varsayılan olarak 1024 olarak ayarlanır. | |
| num_inference_steps (`int`, *isteğe bağlı*, varsayılan 50) : Gürültü azaltma adım sayısı. Daha fazla gürültü azaltma adımı genellikle daha yavaş çıkarım pahasına daha yüksek kaliteli bir görüntüye yol açar. | |
| max_input_image_size (`int`, *isteğe bağlı*, varsayılan 1024) : girdi görüntüsünün maksimum boyutu, girdi görüntüsünün bu maksimum boyuta kırpılmasında kullanılacaktır | |
| timesteps (`list[int]`, *isteğe bağlı*) : `set_timesteps` metodunda `timesteps` argümanını destekleyen zamanlayıcılarla gürültü azaltma süreci için kullanılacak özel zaman adımları. Tanımlanmamışsa, `num_inference_steps` geçirildiğinde varsayılan davranış kullanılacaktır. Azalan sırada olmalıdır. | |
| guidance_scale (`float`, *isteğe bağlı*, varsayılan 2.5) : [Classifier-Free Diffusion Guidance](https://huggingface.co/papers/2207.12598)'de tanımlandığı gibi yönlendirme ölçeği. `guidance_scale`, [Imagen Paper](https://huggingface.co/papers/2205.11487)'deki 2. denklemindeki `w` olarak tanımlanır. Yönlendirme ölçeği, `guidance_scale > 1` olarak ayarlanarak etkinleştirilir. Daha yüksek yönlendirme ölçeği, genellikle daha düşük görüntü kalitesi pahasına, `prompt` ile yakından ilişkili görüntülerin üretilmesini teşvik eder. | |
| img_guidance_scale (`float`, *isteğe bağlı*, varsayılan 1.6) : [Instrucpix2pix](https://huggingface.co/papers/2211.09800)'te denklem 3 olarak tanımlanmıştır. | |
| use_input_image_size_as_output (bool, varsayılan olarak False) : girdi görüntü boyutunun çıktı görüntü boyutu olarak kullanılıp kullanılmayacağını belirtir; bu, tek görüntü girdisi için, örneğin görüntü düzenleme görevi için kullanılabilir | |
| 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 veya [torch üreteci(leri)](https://pytorch.org/docs/stable/generated/torch.Generator.html) listesi. | |
| latents (`torch.Tensor`, *isteğe bağlı*) : Görsel üretimi için girdi olarak kullanılacak, Gauss dağılımından örneklenen önceden oluşturulmuş gürültülü latentler. Farklı istemlerle aynı üretimi ayarlamak için kullanılabilir. Sağlanmazsa, sağlanan rastgele `generator` kullanılarak örneklem yoluyla bir latent tensörü oluşturulur. | |
| output_type (`str`, *isteğe bağlı*, varsayılan `"pil"`) : Üretilen görüntünün çıktı biçimi. [PIL](https://pillow.readthedocs.io/en/stable/): `PIL.Image.Image` veya `np.array` arasında seçim yapın. | |
| return_dict (`bool`, *isteğe bağlı*, varsayılan `True`) : Düz bir tuple yerine `~pipelines.flux.FluxPipelineOutput` döndürülecek mi? | |
| callback_on_step_end (`Callable`, *isteğe bağlı*) : Çıkarım sırasında her gürültü azaltma adımının sonunda çağrılan bir işlev. İşlev aşağıdaki argümanlarla çağrılır: `callback_on_step_end(self: DiffusionPipeline, step: int, timestep: int, callback_kwargs: Dict)`. `callback_kwargs`, `callback_on_step_end_tensor_inputs` tarafından belirtilen tüm tensörlerin listesini içerir. | |
| callback_on_step_end_tensor_inputs (`list`, *isteğe bağlı*) : `callback_on_step_end` işlevi için girdi tensörlerinin listesi. Listede belirtilen tensörler, `callback_kwargs` argümanı olarak geçirilir. Yalnızca pipeline sınıfınızın `._callback_tensor_inputs` özniteliğinde listelenen değişkenleri dahil edebilirsiniz. | |
| **Dönüş:** [ImagePipelineOutput](/docs/diffusers/main/tr/api/pipelines/consistency_models#diffusers.ImagePipelineOutput) veya `tuple` | |
| `return_dict` True ise [ImagePipelineOutput](/docs/diffusers/main/tr/api/pipelines/consistency_models#diffusers.ImagePipelineOutput), aksi halde `tuple`. Tuple döndürüldüğünde, ilk öğe üretilen görüntülerin listesidir. | |
| Üretim için pipeline çağrıldığında tetiklenen işlev. | |
| Örnekler: | |
| ```py | |
| >>> import torch | |
| >>> from diffusers import OmniGenPipeline | |
| >>> pipe = OmniGenPipeline.from_pretrained("Shitao/OmniGen-v1-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, num_inference_steps=50, guidance_scale=2.5).images[0] | |
| >>> image.save("output.png") | |
| ``` | |
| Dönüş: [ImagePipelineOutput](/docs/diffusers/main/tr/api/pipelines/consistency_models#diffusers.ImagePipelineOutput) veya `tuple`: `return_dict` `True` ise [ImagePipelineOutput](/docs/diffusers/main/tr/api/pipelines/consistency_models#diffusers.ImagePipelineOutput) döndürülür, aksi halde ilk öğesi üretilen görüntülerin listesinden oluşan bir `tuple` döndürülür. | |
| #### encode_input_images[[diffusers.OmniGenPipeline.encode_input_images]] | |
| ```python | |
| encode_input_images(input_pixel_values: list, device: typing.Optional[torch.device] = None, dtype: typing.Optional[torch.dtype] = None) | |
| ``` | |
| [Kaynak](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/omnigen/pipeline_omnigen.py#L169) | |
| **Parametreler:** | |
| input_pixel_values : girdi görüntülerinin normalize edilmiş pikseli | |
| cihaz -- | |
| VAE ile giriş görsellerinin devam gömme değerlerini alın | |
| Dönüş: torch.Tensor | |
Xet Storage Details
- Size:
- 22.3 kB
- Xet hash:
- bc0aa5fb1ad062b90646d333db96bf762947c7f53accc069a73bc4c43e4be7c7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.