Update README.md
#19
by
arteivissa - opened
README.md
CHANGED
|
@@ -51,10 +51,19 @@ python3 demo_lora_inference.py \
|
|
| 51 |
--checkpoint lora.safetensors \
|
| 52 |
--prompt " handsome girl in a suit covered with bold tattoos and holding a pistol. Animatrix illustration style, fantasy style, natural photo cinematic"
|
| 53 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |

|
| 56 |
|
| 57 |
|
| 58 |
# License
|
| 59 |
|
| 60 |
-
lora.safetensors falls under the [FLUX.1 [dev]](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) Non-Commercial License<br/>
|
|
|
|
| 51 |
--checkpoint lora.safetensors \
|
| 52 |
--prompt " handsome girl in a suit covered with bold tattoos and holding a pistol. Animatrix illustration style, fantasy style, natural photo cinematic"
|
| 53 |
```
|
| 54 |
+
# Cargar el LoRA con un peso ajustable
|
| 55 |
+
def load_lora_weights(pipe, lora_path, scale=0.75):
|
| 56 |
+
lora_weights = torch.load(lora_path)
|
| 57 |
+
# Aplicar el peso del LoRA (influencia)
|
| 58 |
+
pipe.unet.load_attn_procs(lora_weights, scale=scale)
|
| 59 |
+
|
| 60 |
+
# Generar la imagen con LoRA ajustado
|
| 61 |
+
image = pipe(prompt, num_inference_steps=50).images[0]
|
| 62 |
+
image.show()
|
| 63 |
|
| 64 |

|
| 65 |
|
| 66 |
|
| 67 |
# License
|
| 68 |
|
| 69 |
+
lora.safetensors falls under the [FLUX.1 [dev]](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) Non-Commercial License<br/>
|