Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -124,7 +124,7 @@ refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
|
124 |
refiner.watermark = NoWatermark()
|
125 |
print("Finish Loading Model!")
|
126 |
|
127 |
-
@spaces.GPU()
|
128 |
def generate_image(prompt,
|
129 |
n_prompt="",
|
130 |
style: str = DEFAULT_STYLE_NAME,
|
@@ -140,7 +140,7 @@ def generate_image(prompt,
|
|
140 |
image_list = []
|
141 |
for i in range(img_num):
|
142 |
seed = int(randomize_seed_fn(seeds, random_seed))
|
143 |
-
generator = torch.Generator().manual_seed(seed)
|
144 |
positive_prompt, negative_prompt = apply_style(style, prompt, n_prompt)
|
145 |
image = pipe(positive_prompt, num_inference_steps=steps,
|
146 |
guidance_scale=scale, height=height,
|
|
|
124 |
refiner.watermark = NoWatermark()
|
125 |
print("Finish Loading Model!")
|
126 |
|
127 |
+
@spaces.GPU(duration=120)
|
128 |
def generate_image(prompt,
|
129 |
n_prompt="",
|
130 |
style: str = DEFAULT_STYLE_NAME,
|
|
|
140 |
image_list = []
|
141 |
for i in range(img_num):
|
142 |
seed = int(randomize_seed_fn(seeds, random_seed))
|
143 |
+
generator = torch.Generator(device="cuda").manual_seed(seed)
|
144 |
positive_prompt, negative_prompt = apply_style(style, prompt, n_prompt)
|
145 |
image = pipe(positive_prompt, num_inference_steps=steps,
|
146 |
guidance_scale=scale, height=height,
|