Spaces:
Running
on
Zero
Running
on
Zero
Zero GPU ready
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import os
|
| 3 |
import sys
|
| 4 |
import subprocess
|
|
@@ -54,11 +55,10 @@ def resize_image(input_path, output_path, target_height):
|
|
| 54 |
|
| 55 |
return output_path, new_width, target_height
|
| 56 |
|
|
|
|
| 57 |
def infer(image_in, prompt, inference_steps, guidance_scale, control_weight, progress=gr.Progress(track_tqdm=True)):
|
| 58 |
|
| 59 |
n_prompt = 'NSFW, nude, naked, porn, ugly'
|
| 60 |
-
|
| 61 |
-
|
| 62 |
|
| 63 |
# Canny preprocessing
|
| 64 |
image_to_canny = load_image(image_in)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import spaces
|
| 3 |
import os
|
| 4 |
import sys
|
| 5 |
import subprocess
|
|
|
|
| 55 |
|
| 56 |
return output_path, new_width, target_height
|
| 57 |
|
| 58 |
+
@spaces.GPU()
|
| 59 |
def infer(image_in, prompt, inference_steps, guidance_scale, control_weight, progress=gr.Progress(track_tqdm=True)):
|
| 60 |
|
| 61 |
n_prompt = 'NSFW, nude, naked, porn, ugly'
|
|
|
|
|
|
|
| 62 |
|
| 63 |
# Canny preprocessing
|
| 64 |
image_to_canny = load_image(image_in)
|