Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# requirements: diffusers, transformers, accelerate, safetensors, torch
|
| 2 |
+
# Google Colab'da: pip install diffusers transformers accelerate safetensors
|
| 3 |
+
|
| 4 |
+
from diffusers import StableDiffusionPipeline
|
| 5 |
+
import torch
|
| 6 |
+
|
| 7 |
+
model_id = "runwayml/stable-diffusion-v1-5" # o'zingga mos modelni kirit
|
| 8 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
+
|
| 10 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16 if device=="cuda" else torch.float32)
|
| 11 |
+
pipe = pipe.to(device)
|
| 12 |
+
|
| 13 |
+
prompt = ("Tinker Bell-inspired fairy, photorealistic 3D, sitting on a bed, soft morning light through window, "
|
| 14 |
+
"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")
|
| 15 |
+
negative = "blurry, deformed, extra limbs, bad anatomy, lowres, watermark, text, jpeg artifacts, mutated hands"
|
| 16 |
+
|
| 17 |
+
image = pipe(prompt=prompt,
|
| 18 |
+
negative_prompt=negative,
|
| 19 |
+
guidance_scale=8.0,
|
| 20 |
+
num_inference_steps=30,
|
| 21 |
+
height=1536,
|
| 22 |
+
width=1024).images[0]
|
| 23 |
+
|
| 24 |
+
image.save("tinkerbell_result.png")
|
| 25 |
+
print("Saved: tinkerbell_result.png")
|