Spaces:
Running
Running
use spaces
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import gradio as gr
|
|
4 |
import random
|
5 |
import torch
|
6 |
import math
|
|
|
7 |
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
negative_prompt = "deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck"
|
@@ -19,6 +20,7 @@ css = """
|
|
19 |
}
|
20 |
"""
|
21 |
|
|
|
22 |
def generate(prompt, samp_steps, seed, progress=gr.Progress(track_tqdm=True)):
|
23 |
print("prompt = ", prompt)
|
24 |
turbo_steps=5 # use sweet spot
|
|
|
4 |
import random
|
5 |
import torch
|
6 |
import math
|
7 |
+
import spaces
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
negative_prompt = "deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck"
|
|
|
20 |
}
|
21 |
"""
|
22 |
|
23 |
+
@spaces.GPU(duration=60, enable_queue=True)
|
24 |
def generate(prompt, samp_steps, seed, progress=gr.Progress(track_tqdm=True)):
|
25 |
print("prompt = ", prompt)
|
26 |
turbo_steps=5 # use sweet spot
|