Buckets:
| # Hızlı Başlangıç | |
| Diffusers, görüntü, video ve ses üretimi için kolay bir çıkarım API'si ve yeni iş akışları uygulamak için gerekli yapı taşlarını sunan, geliştiriciler ve araştırmacılar için bir kütüphanedir. | |
| Diffusers, sınırlı belleğe sahip kurulumlarda büyük modellerin yüklenip çalıştırılmasını veya çıkarımın hızlandırılmasını mümkün kılan birçok optimizasyonu kutudan çıktığı gibi sunar. | |
| Bu Hızlı Başlangıç, Diffusers hakkında genel bir bakış sunarak sizi hızla üretime geçirecektir. | |
| > [!TIP] | |
| > Başlamadan önce, [Flux](https://huggingface.co/black-forest-labs/FLUX.1-dev) gibi kapılı modelleri kullanmak için bir Hugging Face [hesabınız](https://huggingface.co/join) olduğundan emin olun. Özel bir pipeline mı oluşturuyorsunuz? [Modular Diffusers hızlı başlangıcı](./modular_diffusers/quickstart) ve [genel bakış](./modular_diffusers/overview) sayfasına göz atın. | |
| Diffusers zaten yüklü değilse, [Yükleme](./installation) kılavuzunu izleyerek Diffusers'ı yükleyin. | |
| ## Ajan istemi | |
| Diffusers'ı çıkarım için yapılandırmak için bunu kodlama aracınıza yapıştırın. | |
| ```text | |
| Help me get set up with Hugging Face Diffusers for inference. | |
| 1. Install Diffusers for my environment with `uv pip install "diffusers[torch]"`. | |
| 2. If I need gated Hub models, help me authenticate to the Hugging Face Hub. | |
| 3. Install Diffusers coding agent skills with `diffusers-cli skills add diffusers-cli`. Pass `--cursor`, `--claude`, or `--codex` if auto-detect fails. Optionally pass `--all` to install every skill in the registry. | |
| 4. Run a first text-to-image with DiffusionPipeline or `diffusers-cli run`, using a small or current Quickstart model and the right `device_map` for my machine. | |
| 5. Ask what I want next and point me at the matching docs. | |
| ``` | |
| ## DiffusionPipeline | |
| [DiffusionPipeline](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline), bir difüzyon modelinin parçalarını (metin kodlayıcı, zamanlayıcı, UNet veya DiT ve VAE) çıkarım için tek bir sınıfta birleştirir. [from_pretrained()](/docs/diffusers/main/tr/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained) ile yükleyin, ardından hattı çağırın. | |
| `__call__()` içindeki `num_inference_steps` gibi argümanlar kaliteyi ve hızı değiştirir. Yükleme ayrıntıları ve bileşenleri karıştırıp eşleştirmek için [Pipeline'ları yükleme](./using-diffusers/loading) bölümüne bakın. Zamanlayıcıyı değiştirmek için [Zamanlayıcılar](./using-diffusers/schedulers) bölümüne bakın. | |
| Aşağıdaki örnekler varsayılan argüman değerlerini kullanır. | |
| Oluşturulan görüntü çıktısına erişmek için `.images[0]` kullanın. | |
| ```py | |
| import torch | |
| from diffusers import DiffusionPipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "Qwen/Qwen-Image", dtype=torch.bfloat16, device_map="cuda" # or "mps", "xpu", "cpu" | |
| ) | |
| prompt = """ | |
| cinematic film still of a cat sipping a margarita in a pool in Palm Springs, California | |
| highly detailed, high budget hollywood movie, cinemascope, moody, epic, gorgeous, film grain | |
| """ | |
| pipeline(prompt).images[0] | |
| ``` | |
| Üretilen video çıktısına erişmek için `.frames[0]` ve videoyu kaydetmek için [export_to_video()](/docs/diffusers/main/tr/api/utilities#diffusers.utils.export_to_video) kullanın. | |
| ```py | |
| import torch | |
| from diffusers import AutoencoderKLWan, DiffusionPipeline | |
| from diffusers.utils import export_to_video | |
| vae = AutoencoderKLWan.from_pretrained( | |
| "Wan-AI/Wan2.2-T2V-A14B-Diffusers", | |
| subfolder="vae", | |
| dtype=torch.float32 | |
| ) | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "Wan-AI/Wan2.2-T2V-A14B-Diffusers", | |
| vae=vae, | |
| dtype=torch.bfloat16, | |
| device_map="cuda" # or "mps", "xpu", "cpu" | |
| ) | |
| prompt = """ | |
| Cinematic video of a sleek cat lounging on a colorful inflatable in a crystal-clear turquoise pool in Palm Springs, | |
| sipping a salt-rimmed margarita through a straw. Golden-hour sunlight glows over mid-century modern homes and swaying palms. | |
| Shot in rich Sony a7S III: with moody, glamorous color grading, subtle lens flares, and soft vintage film grain. | |
| Ripples shimmer as a warm desert breeze stirs the water, blending luxury and playful charm in an epic, gorgeously composed frame. | |
| """ | |
| video = pipeline(prompt=prompt, num_frames=81, num_inference_steps=40).frames[0] | |
| export_to_video(video, "output.mp4", fps=16) | |
| ``` | |
| ## LoRA | |
| [LoRA](./tutorials/using_peft_for_inference) adaptörleri, bir temel hattın üzerine küçük bir stil veya konu kontrol noktası ekler. [load_lora_weights()](/docs/diffusers/main/tr/api/loaders/lora#diffusers.loaders.QwenImageLoraLoaderMixin.load_lora_weights) ile bir tane yükleyin. Bazı LoRA'lar bir tetikleyici ifade gerektirir. LoRA'nın model kartını kontrol edin. | |
| ```py | |
| import torch | |
| from diffusers import DiffusionPipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "Qwen/Qwen-Image", dtype=torch.bfloat16, device_map="cuda" # or "mps", "xpu", "cpu" | |
| ) | |
| pipeline.load_lora_weights( | |
| "threecrowco/VolkClipartQwen", | |
| weight_name="pytorch_lora_weights.safetensors", | |
| ) | |
| prompt = """ | |
| Volk clipart style drawing of a cat sipping a margarita in a pool in Palm Springs, California, flat colors, bold outlines, simple shapes | |
| """ | |
| pipeline(prompt).images[0] | |
| ``` | |
| ## Kantizasyon ve optimizasyonlar | |
| Büyük modeller genellikle daha az bellek veya daha fazla hız gerektirir. Bellekteki ağırlıkları küçültmek için [quantization](./quantization/overview) kullanın ve sonraki generate işlemlerini hızlandırmak için [compile_repeated_blocks()](/docs/diffusers/main/tr/api/models/overview#diffusers.ModelMixin.compile_repeated_blocks) kullanın. [model offloading](./optimization/memory#model-offloading) ve diğer seçenekler için [Optimize and scale](./stable_diffusion) bölümüne bakın. | |
| Daha az bellek kullanmak için bitsandbytes ile 4-bit olarak yükleyin. | |
| ```py | |
| import torch | |
| from diffusers import DiffusionPipeline | |
| from diffusers.quantizers import PipelineQuantizationConfig | |
| quant_config = PipelineQuantizationConfig( | |
| quant_backend="bitsandbytes_4bit", | |
| quant_kwargs={"load_in_4bit": True, "bnb_4bit_quant_type": "nf4", "bnb_4bit_compute_dtype": torch.bfloat16}, | |
| components_to_quantize=["transformer", "text_encoder"], | |
| ) | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "Qwen/Qwen-Image", | |
| dtype=torch.bfloat16, | |
| quantization_config=quant_config, | |
| device_map="cuda" # or "mps", "xpu", "cpu" | |
| ) | |
| prompt = """ | |
| cinematic film still of a cat sipping a margarita in a pool in Palm Springs, California | |
| highly detailed, high budget hollywood movie, cinemascope, moody, epic, gorgeous, film grain | |
| """ | |
| pipeline(prompt).images[0] | |
| ``` | |
| Daha sonraki çalıştırmaları hızlandırmak için transformer üzerindeki tekrarlanan blokları derleyin. Derlemeden sonraki ilk generate soğuk başlatmadır ve yavaştır. Sonraki generate çağrıları daha hızlıdır. | |
| ```py | |
| import torch | |
| from diffusers import DiffusionPipeline | |
| pipeline = DiffusionPipeline.from_pretrained( | |
| "Qwen/Qwen-Image", dtype=torch.bfloat16, device_map="cuda" # or "mps", "xpu", "cpu" | |
| ) | |
| pipeline.transformer.compile_repeated_blocks(fullgraph=True) | |
| prompt = """ | |
| cinematic film still of a cat sipping a margarita in a pool in Palm Springs, California | |
| highly detailed, high budget hollywood movie, cinemascope, moody, epic, gorgeous, film grain | |
| """ | |
| pipeline(prompt).images[0] | |
| ``` | |
| ## Sonraki adımlar | |
| - [Çıkarım](./using-diffusers/loading) — hatlar, istemleme ve adaptörler | |
| - [Optimize et ve ölçeklendir](./stable_diffusion) — bellek, hız, kuantizasyon ve sunum | |
| - [Modüler Diffusers](./modular_diffusers/overview) — birleştirilebilir bloklar ve özel iş akışları | |
| - [Eğit ve ince ayar yap](./training/overview) — eğitim betikleri ve adaptörler | |
| - [CLI](./using-diffusers/cli) — komut satırından üret | |
Xet Storage Details
- Size:
- 7.87 kB
- Xet hash:
- 5ca4b46a50c99d3234a211c9551cf66f078b49ffaf19e06ef56793cae6db44ff
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.