Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -9,12 +9,11 @@ pipe = FluxPipeline.from_pretrained(
|
|
| 9 |
'black-forest-labs/FLUX.1-dev',
|
| 10 |
torch_dtype=torch.bfloat16,
|
| 11 |
use_safetensors=True
|
| 12 |
-
)
|
| 13 |
-
pipe.to('cuda')
|
| 14 |
|
| 15 |
-
# Load SRPO weights
|
| 16 |
-
state_dict = load_file("diffusion_pytorch_model.safetensors")
|
| 17 |
-
pipe.transformer.load_state_dict(state_dict
|
| 18 |
|
| 19 |
@spaces.GPU(duration=120)
|
| 20 |
def generate_image(
|
|
|
|
| 9 |
'black-forest-labs/FLUX.1-dev',
|
| 10 |
torch_dtype=torch.bfloat16,
|
| 11 |
use_safetensors=True
|
| 12 |
+
).to('cuda')
|
|
|
|
| 13 |
|
| 14 |
+
# Load SRPO weights from https://huggingface.co/tencent/SRPO
|
| 15 |
+
state_dict = load_file("tencent/SRPO/diffusion_pytorch_model.safetensors")
|
| 16 |
+
pipe.transformer.load_state_dict(state_dict)
|
| 17 |
|
| 18 |
@spaces.GPU(duration=120)
|
| 19 |
def generate_image(
|