Spaces:
Running
on
Zero
Running
on
Zero
Suggested by @ehristoforu
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ pipe.scheduler = DPMSolverSinglestepScheduler.from_config(pipe.scheduler.config,
|
|
16 |
MAX_SEED = np.iinfo(np.int32).max
|
17 |
MAX_IMAGE_SIZE = 4096
|
18 |
|
19 |
-
@spaces.GPU(duration=
|
20 |
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
21 |
if randomize_seed:
|
22 |
seed = random.randint(0, MAX_SEED)
|
@@ -39,7 +39,15 @@ examples = [
|
|
39 |
"An alien grasping a sign board contain word 'Flash', detailed",
|
40 |
]
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
with gr.Column():
|
44 |
gr.Markdown("""# SDXL Flash
|
45 |
### Super fast text to Image Generator.
|
@@ -63,9 +71,10 @@ with gr.Blocks() as demo:
|
|
63 |
|
64 |
negative_prompt = gr.Text(
|
65 |
label="Negative prompt",
|
66 |
-
max_lines=
|
|
|
67 |
placeholder="Enter a negative prompt",
|
68 |
-
value = "(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation,
|
69 |
)
|
70 |
|
71 |
seed = gr.Slider(
|
@@ -82,26 +91,26 @@ with gr.Blocks() as demo:
|
|
82 |
|
83 |
width = gr.Slider(
|
84 |
label="Width",
|
85 |
-
minimum=
|
86 |
maximum=MAX_IMAGE_SIZE,
|
87 |
-
step=
|
88 |
-
value=
|
89 |
)
|
90 |
|
91 |
height = gr.Slider(
|
92 |
label="Height",
|
93 |
-
minimum=
|
94 |
maximum=MAX_IMAGE_SIZE,
|
95 |
-
step=
|
96 |
-
value=
|
97 |
)
|
98 |
|
99 |
with gr.Row():
|
100 |
|
101 |
guidance_scale = gr.Slider(
|
102 |
label="Guidance scale",
|
103 |
-
minimum=
|
104 |
-
maximum=
|
105 |
step=0.1,
|
106 |
value=3.0,
|
107 |
)
|
@@ -125,4 +134,4 @@ with gr.Blocks() as demo:
|
|
125 |
outputs = [result]
|
126 |
)
|
127 |
|
128 |
-
demo.queue().launch()
|
|
|
16 |
MAX_SEED = np.iinfo(np.int32).max
|
17 |
MAX_IMAGE_SIZE = 4096
|
18 |
|
19 |
+
@spaces.GPU(duration=120,queue=False)
|
20 |
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
21 |
if randomize_seed:
|
22 |
seed = random.randint(0, MAX_SEED)
|
|
|
39 |
"An alien grasping a sign board contain word 'Flash', detailed",
|
40 |
]
|
41 |
|
42 |
+
css = '''
|
43 |
+
.gradio-container{max-width: 560px !important}
|
44 |
+
h1{text-align:center}
|
45 |
+
footer {
|
46 |
+
visibility: hidden
|
47 |
+
}
|
48 |
+
'''
|
49 |
+
|
50 |
+
with gr.Blocks(title="SDXL Flash", css=css) as demo:
|
51 |
with gr.Column():
|
52 |
gr.Markdown("""# SDXL Flash
|
53 |
### Super fast text to Image Generator.
|
|
|
71 |
|
72 |
negative_prompt = gr.Text(
|
73 |
label="Negative prompt",
|
74 |
+
max_lines=5,
|
75 |
+
lines=4,
|
76 |
placeholder="Enter a negative prompt",
|
77 |
+
value = "(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, NSFW",
|
78 |
)
|
79 |
|
80 |
seed = gr.Slider(
|
|
|
91 |
|
92 |
width = gr.Slider(
|
93 |
label="Width",
|
94 |
+
minimum=512,
|
95 |
maximum=MAX_IMAGE_SIZE,
|
96 |
+
step=8,
|
97 |
+
value=1024,
|
98 |
)
|
99 |
|
100 |
height = gr.Slider(
|
101 |
label="Height",
|
102 |
+
minimum=512,
|
103 |
maximum=MAX_IMAGE_SIZE,
|
104 |
+
step=8,
|
105 |
+
value=1024,
|
106 |
)
|
107 |
|
108 |
with gr.Row():
|
109 |
|
110 |
guidance_scale = gr.Slider(
|
111 |
label="Guidance scale",
|
112 |
+
minimum=0.0,
|
113 |
+
maximum=10.0,
|
114 |
step=0.1,
|
115 |
value=3.0,
|
116 |
)
|
|
|
134 |
outputs = [result]
|
135 |
)
|
136 |
|
137 |
+
demo.queue().launch(show_api=False)
|