Spaces:
Running
on
Zero
Running
on
Zero
Test3
Browse files
app.py
CHANGED
@@ -16,7 +16,8 @@ import torch
|
|
16 |
|
17 |
model_name = "Qwen/Qwen-Image"
|
18 |
|
19 |
-
|
|
|
20 |
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
MAX_IMAGE_SIZE = 1440
|
@@ -48,15 +49,7 @@ def infer_diffusers(
|
|
48 |
num_inference_steps=50,
|
49 |
progress=gr.Progress(track_tqdm=True),
|
50 |
):
|
51 |
-
|
52 |
-
if torch.cuda.is_available():
|
53 |
-
torch_dtype = torch.bfloat16
|
54 |
-
device = "cuda"
|
55 |
-
else:
|
56 |
-
torch_dtype = torch.float32
|
57 |
-
device = "cpu"
|
58 |
-
|
59 |
-
pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
|
60 |
|
61 |
if randomize_seed:
|
62 |
seed = random.randint(0, MAX_SEED)
|
|
|
16 |
|
17 |
model_name = "Qwen/Qwen-Image"
|
18 |
|
19 |
+
pipe = DiffusionPipeline.from_pretrained(model_name, torch_dtype=torch_dtype)
|
20 |
+
pipe.to('cuda')
|
21 |
|
22 |
MAX_SEED = np.iinfo(np.int32).max
|
23 |
MAX_IMAGE_SIZE = 1440
|
|
|
49 |
num_inference_steps=50,
|
50 |
progress=gr.Progress(track_tqdm=True),
|
51 |
):
|
52 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
if randomize_seed:
|
55 |
seed = random.randint(0, MAX_SEED)
|