File size: 1,193 Bytes
5b7141b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# requirements: diffusers, transformers, accelerate, safetensors, torch
# Google Colab'da: pip install diffusers transformers accelerate safetensors

from diffusers import StableDiffusionPipeline
import torch

model_id = "runwayml/stable-diffusion-v1-5"  # o'zingga mos modelni kirit
device = "cuda" if torch.cuda.is_available() else "cpu"

pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if device=="cuda" else torch.float32)
pipe = pipe.to(device)

prompt = ("Tinker Bell-inspired fairy, photorealistic 3D, sitting on a bed, soft morning light through window, "
          "delicate translucent wings with filigree patterns, green lace lingerie, dreamy cinematic lighting, high detail skin texture, shallow depth of field, 85mm, filmic color grading, ultra-detailed, 8k")
negative = "blurry, deformed, extra limbs, bad anatomy, lowres, watermark, text, jpeg artifacts, mutated hands"

image = pipe(prompt=prompt,
             negative_prompt=negative,
             guidance_scale=8.0,
             num_inference_steps=30,
             height=1536,
             width=1024).images[0]

image.save("tinkerbell_result.png")
print("Saved: tinkerbell_result.png")