Spaces:
Runtime error
Runtime error
Commit
•
bfcac1a
1
Parent(s):
36c9e2e
Update app.py
Browse files
app.py
CHANGED
@@ -9,14 +9,12 @@ from transformers import CLIPTextModel, CLIPTokenizer,T5EncoderModel, T5Tokenize
|
|
9 |
dtype = torch.bfloat16
|
10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
11 |
|
12 |
-
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, revision="refs/pr/3").to(device)
|
13 |
-
|
14 |
MAX_SEED = np.iinfo(np.int32).max
|
15 |
MAX_IMAGE_SIZE = 2048
|
16 |
|
17 |
@spaces.GPU()
|
18 |
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=5.0, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
19 |
-
pipe.to("cuda")
|
20 |
if randomize_seed:
|
21 |
seed = random.randint(0, MAX_SEED)
|
22 |
generator = torch.Generator().manual_seed(seed)
|
|
|
9 |
dtype = torch.bfloat16
|
10 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
11 |
|
|
|
|
|
12 |
MAX_SEED = np.iinfo(np.int32).max
|
13 |
MAX_IMAGE_SIZE = 2048
|
14 |
|
15 |
@spaces.GPU()
|
16 |
def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidance_scale=5.0, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
17 |
+
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16, revision="refs/pr/3").to("cuda")
|
18 |
if randomize_seed:
|
19 |
seed = random.randint(0, MAX_SEED)
|
20 |
generator = torch.Generator().manual_seed(seed)
|