Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -234,12 +234,12 @@ with gr.Blocks(css=css) as demo:
|
|
234 |
uploaded_image.change(fn=image2image, inputs=[uploaded_image, image_url, gr.State(False)], outputs=additional_image_output)
|
235 |
image_url.submit(fn=image2image, inputs=[uploaded_image, image_url, gr.State(False)], outputs=additional_image_output)
|
236 |
|
237 |
-
@spaces.GPU
|
238 |
def infer2(prompt, image, seed=42, randomize_seed=False, width=1024, height=1024, strength=.5, guidance_scale=5.0, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
239 |
if randomize_seed:
|
240 |
seed = random.randint(0, MAX_SEED)
|
241 |
generator = torch.Generator(device=device).manual_seed(seed)
|
242 |
-
|
243 |
# generator = torch.Generator().manual_seed(seed)
|
244 |
# image = pipe(
|
245 |
# prompt=prompt,
|
|
|
234 |
uploaded_image.change(fn=image2image, inputs=[uploaded_image, image_url, gr.State(False)], outputs=additional_image_output)
|
235 |
image_url.submit(fn=image2image, inputs=[uploaded_image, image_url, gr.State(False)], outputs=additional_image_output)
|
236 |
|
237 |
+
@spaces.GPU(duration=190)
|
238 |
def infer2(prompt, image, seed=42, randomize_seed=False, width=1024, height=1024, strength=.5, guidance_scale=5.0, num_inference_steps=28, progress=gr.Progress(track_tqdm=True)):
|
239 |
if randomize_seed:
|
240 |
seed = random.randint(0, MAX_SEED)
|
241 |
generator = torch.Generator(device=device).manual_seed(seed)
|
242 |
+
image2 = pipeline2Image(prompt=prompt, image=image, strength=strength, guidance_scale=guidance_scale, num_inference_steps=num_inference_steps, generator=generator).images[0]
|
243 |
# generator = torch.Generator().manual_seed(seed)
|
244 |
# image = pipe(
|
245 |
# prompt=prompt,
|