Update app.py
Browse files
app.py
CHANGED
@@ -4,13 +4,14 @@ import random
|
|
4 |
#import spaces #[uncomment to use ZeroGPU]
|
5 |
from diffusers import DiffusionPipeline, FluxPipeline
|
6 |
import torch
|
7 |
-
import
|
8 |
-
|
9 |
-
transformers.utils.move_cache()
|
10 |
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
model_repo_id = "black-forest-labs/FLUX.1-schnell" #Replace to the model you would like to use
|
13 |
|
|
|
|
|
|
|
14 |
if torch.cuda.is_available():
|
15 |
torch_dtype = torch.float16
|
16 |
else:
|
|
|
4 |
#import spaces #[uncomment to use ZeroGPU]
|
5 |
from diffusers import DiffusionPipeline, FluxPipeline
|
6 |
import torch
|
7 |
+
from transformers import AutoTokenizer
|
|
|
|
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
model_repo_id = "black-forest-labs/FLUX.1-schnell" #Replace to the model you would like to use
|
11 |
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained(model_repo_id, use_fast=True)
|
13 |
+
tokenizer.add_prefix_space = False
|
14 |
+
|
15 |
if torch.cuda.is_available():
|
16 |
torch_dtype = torch.float16
|
17 |
else:
|