Buckets:

mishig's picture
|
download
raw
2.06 kB
# Metin yönlendirmeli derinlikten görüntüye üretim
[StableDiffusionDepth2ImgPipeline](/docs/diffusers/main/tr/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline), yeni görüntülerin oluşturulması için bir metin komutu ve başlangıç görüntüsü geçmenizi sağlar. Ayrıca, görüntü yapısını korumak için bir `depth_map` de geçebilirsiniz. `depth_map` sağlanmazsa, pipeline entegre bir [depth-estimation model](https://github.com/isl-org/MiDaS) aracılığıyla derinliği otomatik olarak tahmin eder.
[StableDiffusionDepth2ImgPipeline](/docs/diffusers/main/tr/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline) sınıfının bir örneğini oluşturarak başlayın:
```python
import torch
from diffusers import StableDiffusionDepth2ImgPipeline
from diffusers.utils import load_image, make_image_grid
pipeline = StableDiffusionDepth2ImgPipeline.from_pretrained(
"stabilityai/stable-diffusion-2-depth",
dtype=torch.float16,
use_safetensors=True,
).to("cuda") # or "mps", "xpu", "cpu"
```
Şimdi komutunuzu (prompt) pipeline'a iletin. Bir görselin nasıl oluşturulacağını yönlendiren belirli kelimeleri engellemek için `negative_prompt` da iletebilirsiniz:
```python
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
init_image = load_image(url)
prompt = "two tigers"
negative_prompt = "bad, deformed, ugly, bad anatomy"
image = pipeline(prompt=prompt, image=init_image, negative_prompt=negative_prompt, strength=0.7).images[0]
make_image_grid([init_image, image], rows=1, cols=2)
```
| Girdi | Çıktı |
|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| | |

Xet Storage Details

Size:
2.06 kB
·
Xet hash:
b6d0eb074fe99814e03d35ff3416f407c76eb05989c159276168319803f8628e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.