Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import spaces
|
| 3 |
import torch
|
| 4 |
import random
|
| 5 |
-
from diffusers import DiffusionPipeline, AutoPipelineForText2Image
|
| 6 |
import os
|
| 7 |
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
@@ -19,7 +19,7 @@ def generate(prompt, negative_prompt, model=image_model):
|
|
| 19 |
negative_prompt = "ugly, deformed, disfigured, poor quality, low resolution"
|
| 20 |
if model == 'enhanceaiteam/Flux-uncensored-v2':
|
| 21 |
# Load the base model
|
| 22 |
-
pipe =
|
| 23 |
|
| 24 |
# Load the uncensored LoRA weights
|
| 25 |
pipe.load_lora_weights('enhanceaiteam/Flux-uncensored-v2', weight_name='lora.safetensors')
|
|
|
|
| 2 |
import spaces
|
| 3 |
import torch
|
| 4 |
import random
|
| 5 |
+
from diffusers import DiffusionPipeline, AutoPipelineForText2Image, FluxPipeline
|
| 6 |
import os
|
| 7 |
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 19 |
negative_prompt = "ugly, deformed, disfigured, poor quality, low resolution"
|
| 20 |
if model == 'enhanceaiteam/Flux-uncensored-v2':
|
| 21 |
# Load the base model
|
| 22 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, token=hf_token).to('cuda')
|
| 23 |
|
| 24 |
# Load the uncensored LoRA weights
|
| 25 |
pipe.load_lora_weights('enhanceaiteam/Flux-uncensored-v2', weight_name='lora.safetensors')
|