Update README.md
Browse files
README.md
CHANGED
@@ -19,40 +19,10 @@ pipeline_tag: text-to-image
|
|
19 |
instance_prompt: TOK
|
20 |
---
|
21 |
|
22 |
-
#
|
23 |
|
24 |
<Gallery />
|
25 |
|
26 |
-
## About this LoRA
|
27 |
-
|
28 |
-
This is a [LoRA](https://replicate.com/docs/guides/working-with-loras) for the FLUX.1-dev text-to-image model. It can be used with diffusers or ComfyUI.
|
29 |
-
|
30 |
-
It was trained on [Replicate](https://replicate.com/) using AI toolkit: https://replicate.com/ostris/flux-dev-lora-trainer/train
|
31 |
-
|
32 |
-
|
33 |
-
## Trigger words
|
34 |
-
|
35 |
-
You should use `TOK` to trigger the image generation.
|
36 |
-
|
37 |
-
|
38 |
-
## Run this LoRA with an API using Replicate
|
39 |
-
|
40 |
-
```py
|
41 |
-
import replicate
|
42 |
-
|
43 |
-
input = {
|
44 |
-
"prompt": "TOK",
|
45 |
-
"lora_weights": "https://huggingface.co/codermert/malikafinal/resolve/main/lora.safetensors"
|
46 |
-
}
|
47 |
-
|
48 |
-
output = replicate.run(
|
49 |
-
"black-forest-labs/flux-dev-lora",
|
50 |
-
input=input
|
51 |
-
)
|
52 |
-
for index, item in enumerate(output):
|
53 |
-
with open(f"output_{index}.webp", "wb") as file:
|
54 |
-
file.write(item.read())
|
55 |
-
```
|
56 |
|
57 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
58 |
|
@@ -60,21 +30,25 @@ for index, item in enumerate(output):
|
|
60 |
from diffusers import AutoPipelineForText2Image
|
61 |
import torch
|
62 |
|
63 |
-
|
64 |
-
pipeline
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
```
|
67 |
|
68 |
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)
|
69 |
-
|
70 |
-
|
71 |
-
## Training details
|
72 |
-
|
73 |
-
- Steps: 2002
|
74 |
-
- Learning rate: 0.0004
|
75 |
-
- LoRA rank: 16
|
76 |
-
|
77 |
-
|
78 |
-
## Contribute your own examples
|
79 |
-
|
80 |
-
You can use the [community tab](https://huggingface.co/codermert/malikafinal/discussions) to add images that show off what you’ve made with this LoRA.
|
|
|
19 |
instance_prompt: TOK
|
20 |
---
|
21 |
|
22 |
+
# Malika
|
23 |
|
24 |
<Gallery />
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
## Use it with the [🧨 diffusers library](https://github.com/huggingface/diffusers)
|
28 |
|
|
|
30 |
from diffusers import AutoPipelineForText2Image
|
31 |
import torch
|
32 |
|
33 |
+
# 1. Realistic Vision modelini yükle
|
34 |
+
pipeline = AutoPipelineForText2Image.from_pretrained(
|
35 |
+
"prithivMLmods/Canopus-LoRA-Flux-UltraRealism-2.0",
|
36 |
+
torch_dtype=torch.float16
|
37 |
+
).to("cuda")
|
38 |
+
|
39 |
+
# 2. LoRA'yı zorla yükle (alpha=0.5 ile gücünü azaltın)
|
40 |
+
pipeline.load_lora_weights(
|
41 |
+
"codermert/malikafinal",
|
42 |
+
weight_name="lora.safetensors",
|
43 |
+
adapter_name="fluxx",
|
44 |
+
cross_attention_scale=0.5 # LoRA etkisini hafiflet
|
45 |
+
)
|
46 |
+
|
47 |
+
# 3. Promptta hem trigger hem stil vurgusu yapın
|
48 |
+
image = pipeline(
|
49 |
+
prompt="portrait of TOK, <fluxx>, photorealistic, 8K", # TOK + adapter_name
|
50 |
+
negative_prompt="blurry, deformed"
|
51 |
+
).images[0]
|
52 |
```
|
53 |
|
54 |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|