Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
|
15 |
pipe = pipe.to(device)
|
16 |
|
17 |
MAX_SEED = np.iinfo(np.int32).max
|
18 |
-
MAX_IMAGE_SIZE =
|
19 |
|
20 |
def truncate_text(text, max_tokens=77):
|
21 |
"""
|
@@ -28,14 +28,14 @@ def truncate_text(text, max_tokens=77):
|
|
28 |
truncated_text = pipe.tokenizer.decode(tokens["input_ids"], skip_special_tokens=True)
|
29 |
return truncated_text
|
30 |
|
31 |
-
@spaces.GPU(duration=
|
32 |
def infer(
|
33 |
prompt,
|
34 |
negative_prompt="",
|
35 |
seed=42,
|
36 |
randomize_seed=False,
|
37 |
-
width=
|
38 |
-
height=
|
39 |
guidance_scale=4.5,
|
40 |
num_inference_steps=40,
|
41 |
progress=gr.Progress(track_tqdm=True),
|
|
|
15 |
pipe = pipe.to(device)
|
16 |
|
17 |
MAX_SEED = np.iinfo(np.int32).max
|
18 |
+
MAX_IMAGE_SIZE = 2048
|
19 |
|
20 |
def truncate_text(text, max_tokens=77):
|
21 |
"""
|
|
|
28 |
truncated_text = pipe.tokenizer.decode(tokens["input_ids"], skip_special_tokens=True)
|
29 |
return truncated_text
|
30 |
|
31 |
+
@spaces.GPU(duration=85)
|
32 |
def infer(
|
33 |
prompt,
|
34 |
negative_prompt="",
|
35 |
seed=42,
|
36 |
randomize_seed=False,
|
37 |
+
width=2048,
|
38 |
+
height=2048,
|
39 |
guidance_scale=4.5,
|
40 |
num_inference_steps=40,
|
41 |
progress=gr.Progress(track_tqdm=True),
|