Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,12 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
# Load the base model
|
4 |
-
|
5 |
-
return gr.load("black-forest-labs/FLUX.1-dev", src="models")
|
6 |
|
7 |
-
# Load the LoRA
|
8 |
-
|
9 |
-
return gr.load("models/enhanceaiteam/Flux-Uncensored-V2", lora=True)
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
# Launch the interfaces
|
16 |
-
base_model.launch()
|
17 |
-
lora_model.launch()
|
|
|
1 |
+
from diffusers import AutoPipelineForText2Image
|
2 |
+
import torch
|
3 |
|
4 |
+
# Load the base model
|
5 |
+
pipeline = AutoPipelineForText2Image.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to('cuda')
|
|
|
6 |
|
7 |
+
# Load the uncensored LoRA weights
|
8 |
+
pipeline.load_lora_weights('enhanceaiteam/Flux-uncensored-v2', weight_name='lora.safetensors')
|
|
|
9 |
|
10 |
+
# Generate an image with an uncensored NSFW prompt
|
11 |
+
image = pipeline('a naked cute girl').images[0]
|
12 |
+
image.show()
|
|
|
|
|
|
|
|