Update README.md
Browse files
README.md
CHANGED
|
@@ -35,12 +35,37 @@ You should use `TOK` to trigger the image generation.
|
|
| 35 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
| 36 |
|
| 37 |
```py
|
| 38 |
-
from diffusers import AutoPipelineForText2Image
|
| 39 |
import torch
|
| 40 |
|
| 41 |
-
|
| 42 |
-
pipeline
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
```
|
| 45 |
|
| 46 |
For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters)
|
|
|
|
| 35 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
| 36 |
|
| 37 |
```py
|
| 38 |
+
from diffusers import AutoPipelineForText2Image, AutoencoderKL
|
| 39 |
import torch
|
| 40 |
|
| 41 |
+
# 1. Ana modeli yükle
|
| 42 |
+
pipeline = AutoPipelineForText2Image.from_pretrained(
|
| 43 |
+
"SG161222/Realistic_Vision_V6.0_B1_noVAE",
|
| 44 |
+
torch_dtype=torch.float16,
|
| 45 |
+
variant="fp16"
|
| 46 |
+
).to("cuda")
|
| 47 |
+
|
| 48 |
+
# 2. VAE ekle (opsiyonel)
|
| 49 |
+
pipeline.vae = AutoencoderKL.from_pretrained(
|
| 50 |
+
"stabilityai/sd-vae-ft-mse",
|
| 51 |
+
torch_dtype=torch.float16
|
| 52 |
+
).to("cuda")
|
| 53 |
+
|
| 54 |
+
# 3. LoRA'yı yükle
|
| 55 |
+
pipeline.load_lora_weights(
|
| 56 |
+
"codermert/gamzekocc_fluxx",
|
| 57 |
+
weight_name="lora.safetensors",
|
| 58 |
+
adapter_name="fluxx_style"
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
# 4. Görüntü oluştur
|
| 62 |
+
image = pipeline(
|
| 63 |
+
prompt="portrait of a cyber ninja, <fluxx_style>, ultra-detailed, 8K",
|
| 64 |
+
negative_prompt="blurry, cartoon, deformed",
|
| 65 |
+
num_inference_steps=30
|
| 66 |
+
).images[0]
|
| 67 |
+
|
| 68 |
+
image.save("cyber_ninja.png")
|
| 69 |
```
|
| 70 |
|
| 71 |
For more details, including weighting, merging and fusing LoRAs, check the [documentation on loading LoRAs in diffusers](https://huggingface.co/docs/diffusers/main/en/using-diffusers/loading_adapters)
|