Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -129,11 +129,28 @@ css = """
|
|
| 129 |
"""
|
| 130 |
|
| 131 |
with gr.Blocks(css=css) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
with gr.Column(elem_id="col-container"):
|
| 134 |
if not model_loaded:
|
| 135 |
gr.Markdown("⚠️ **Model failed to load. Please check your Hugging Face token.**")
|
| 136 |
-
|
| 137 |
with gr.Row():
|
| 138 |
prompt = gr.Text(
|
| 139 |
label="Prompt",
|
|
@@ -142,20 +159,16 @@ with gr.Blocks(css=css) as demo:
|
|
| 142 |
placeholder="Enter your prompt (long prompts are automatically supported)",
|
| 143 |
container=False,
|
| 144 |
)
|
| 145 |
-
|
| 146 |
run_button = gr.Button("Run", scale=0)
|
| 147 |
-
|
| 148 |
result = gr.Image(label="Result", show_label=False)
|
| 149 |
|
| 150 |
with gr.Accordion("Advanced Settings", open=False):
|
| 151 |
-
|
| 152 |
negative_prompt = gr.Text(
|
| 153 |
label="Negative prompt",
|
| 154 |
max_lines=1,
|
| 155 |
placeholder="Enter a negative prompt",
|
| 156 |
value="nsfw, (low quality, worst quality:1.2), very displeasing, 3d, watermark, signature, ugly, poorly drawn"
|
| 157 |
)
|
| 158 |
-
|
| 159 |
seed = gr.Slider(
|
| 160 |
label="Seed",
|
| 161 |
minimum=0,
|
|
@@ -163,9 +176,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 163 |
step=1,
|
| 164 |
value=0,
|
| 165 |
)
|
| 166 |
-
|
| 167 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
| 168 |
-
|
| 169 |
with gr.Row():
|
| 170 |
width = gr.Slider(
|
| 171 |
label="Width",
|
|
@@ -174,7 +185,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 174 |
step=32,
|
| 175 |
value=1024,
|
| 176 |
)
|
| 177 |
-
|
| 178 |
height = gr.Slider(
|
| 179 |
label="Height",
|
| 180 |
minimum=256,
|
|
@@ -182,7 +192,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 182 |
step=32,
|
| 183 |
value=1024,
|
| 184 |
)
|
| 185 |
-
|
| 186 |
with gr.Row():
|
| 187 |
guidance_scale = gr.Slider(
|
| 188 |
label="Guidance scale",
|
|
@@ -191,7 +200,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 191 |
step=0.1,
|
| 192 |
value=7,
|
| 193 |
)
|
| 194 |
-
|
| 195 |
num_inference_steps = gr.Slider(
|
| 196 |
label="Number of inference steps",
|
| 197 |
minimum=1,
|
|
@@ -199,11 +207,9 @@ with gr.Blocks(css=css) as demo:
|
|
| 199 |
step=1,
|
| 200 |
value=28,
|
| 201 |
)
|
| 202 |
-
|
| 203 |
run_button.click(
|
| 204 |
fn=infer,
|
| 205 |
inputs=[prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
| 206 |
outputs=[result]
|
| 207 |
)
|
| 208 |
-
|
| 209 |
demo.queue().launch()
|
|
|
|
| 129 |
"""
|
| 130 |
|
| 131 |
with gr.Blocks(css=css) as demo:
|
| 132 |
+
|
| 133 |
+
gr.HTML("""
|
| 134 |
+
<style>
|
| 135 |
+
.gradio-container {
|
| 136 |
+
background: linear-gradient(135deg, #fef9f3 0%, #f0e6fa 50%, #e6f0fa 100%) !important;
|
| 137 |
+
}
|
| 138 |
+
footer {display: none !important;}
|
| 139 |
+
</style>
|
| 140 |
+
<div style="text-align: center; margin-bottom: 20px;">
|
| 141 |
+
<h1 style="color: #6b5b7a; font-size: 2.2rem; font-weight: 700; margin-bottom: 0.3rem;">
|
| 142 |
+
🎨 Unfiltered AI NSFW Image Generator
|
| 143 |
+
</h1>
|
| 144 |
+
<p style="color: #8b7b9b; font-size: 1rem;">Enter creative prompts and generate high-quality images.</p>
|
| 145 |
+
<div style="margin-top: 10px;">
|
| 146 |
+
<a href="https://huggingface.co/spaces/Heartsync/FREE-NSFW-HUB" target="_blank"><img src="https://img.shields.io/static/v1?label=FREE&message=NSFW%20HUB&color=%230000ff&labelColor=%23800080&logo=huggingface&logoColor=white&style=for-the-badge" alt="badge"></a>
|
| 147 |
+
</div>
|
| 148 |
+
</div>
|
| 149 |
+
""")
|
| 150 |
|
| 151 |
with gr.Column(elem_id="col-container"):
|
| 152 |
if not model_loaded:
|
| 153 |
gr.Markdown("⚠️ **Model failed to load. Please check your Hugging Face token.**")
|
|
|
|
| 154 |
with gr.Row():
|
| 155 |
prompt = gr.Text(
|
| 156 |
label="Prompt",
|
|
|
|
| 159 |
placeholder="Enter your prompt (long prompts are automatically supported)",
|
| 160 |
container=False,
|
| 161 |
)
|
|
|
|
| 162 |
run_button = gr.Button("Run", scale=0)
|
|
|
|
| 163 |
result = gr.Image(label="Result", show_label=False)
|
| 164 |
|
| 165 |
with gr.Accordion("Advanced Settings", open=False):
|
|
|
|
| 166 |
negative_prompt = gr.Text(
|
| 167 |
label="Negative prompt",
|
| 168 |
max_lines=1,
|
| 169 |
placeholder="Enter a negative prompt",
|
| 170 |
value="nsfw, (low quality, worst quality:1.2), very displeasing, 3d, watermark, signature, ugly, poorly drawn"
|
| 171 |
)
|
|
|
|
| 172 |
seed = gr.Slider(
|
| 173 |
label="Seed",
|
| 174 |
minimum=0,
|
|
|
|
| 176 |
step=1,
|
| 177 |
value=0,
|
| 178 |
)
|
|
|
|
| 179 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
|
|
|
| 180 |
with gr.Row():
|
| 181 |
width = gr.Slider(
|
| 182 |
label="Width",
|
|
|
|
| 185 |
step=32,
|
| 186 |
value=1024,
|
| 187 |
)
|
|
|
|
| 188 |
height = gr.Slider(
|
| 189 |
label="Height",
|
| 190 |
minimum=256,
|
|
|
|
| 192 |
step=32,
|
| 193 |
value=1024,
|
| 194 |
)
|
|
|
|
| 195 |
with gr.Row():
|
| 196 |
guidance_scale = gr.Slider(
|
| 197 |
label="Guidance scale",
|
|
|
|
| 200 |
step=0.1,
|
| 201 |
value=7,
|
| 202 |
)
|
|
|
|
| 203 |
num_inference_steps = gr.Slider(
|
| 204 |
label="Number of inference steps",
|
| 205 |
minimum=1,
|
|
|
|
| 207 |
step=1,
|
| 208 |
value=28,
|
| 209 |
)
|
|
|
|
| 210 |
run_button.click(
|
| 211 |
fn=infer,
|
| 212 |
inputs=[prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
| 213 |
outputs=[result]
|
| 214 |
)
|
|
|
|
| 215 |
demo.queue().launch()
|