Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,15 +4,18 @@ import random
|
|
4 |
from PIL import Image
|
5 |
import spaces
|
6 |
import torch
|
7 |
-
from huggingface_hub import hf_hub_download
|
8 |
from diffusers import FluxPriorReduxPipeline, FluxPipeline
|
9 |
from diffusers.utils import load_image
|
10 |
-
|
|
|
|
|
|
|
11 |
MAX_SEED = np.iinfo(np.int32).max
|
12 |
MAX_IMAGE_SIZE = 2048
|
13 |
|
14 |
pipe = FluxPipeline.from_pretrained(
|
15 |
-
"
|
16 |
torch_dtype=torch.bfloat16
|
17 |
).to("cuda")
|
18 |
pipe.load_lora_weights(hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), lora_scale=0.125)
|
|
|
4 |
from PIL import Image
|
5 |
import spaces
|
6 |
import torch
|
7 |
+
from huggingface_hub import hf_hub_download, HfApi
|
8 |
from diffusers import FluxPriorReduxPipeline, FluxPipeline
|
9 |
from diffusers.utils import load_image
|
10 |
+
import os
|
11 |
+
api = HfApi(
|
12 |
+
token=os.getenv('HF_TOKEN'), # Token is not persisted on the machine.
|
13 |
+
)
|
14 |
MAX_SEED = np.iinfo(np.int32).max
|
15 |
MAX_IMAGE_SIZE = 2048
|
16 |
|
17 |
pipe = FluxPipeline.from_pretrained(
|
18 |
+
"LPX55/FLUX.1-merged_uncensored",
|
19 |
torch_dtype=torch.bfloat16
|
20 |
).to("cuda")
|
21 |
pipe.load_lora_weights(hf_hub_download("ByteDance/Hyper-SD", "Hyper-FLUX.1-dev-8steps-lora.safetensors"), lora_scale=0.125)
|