Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,27 +35,11 @@ def infer(
|
|
| 35 |
num_inference_steps,
|
| 36 |
progress=gr.Progress(track_tqdm=True),
|
| 37 |
):
|
| 38 |
-
# --- Anti-NSFW patching ---
|
| 39 |
-
prompt = prompt + " (avoid nsfw)"
|
| 40 |
-
|
| 41 |
-
negative_prompt = (
|
| 42 |
-
negative_prompt
|
| 43 |
-
+ " (breasts:3), (nipple:3), (nipples:3), (boobs:3), (butt:3), (ass:3),"
|
| 44 |
-
" (butthole:3), (sex:3), (fetish:3), (pussy:3), (vagina:3), (porn:3),"
|
| 45 |
-
" (hentai:3), (explicit:3), (areola:3), (genitals:3), (penis:3),"
|
| 46 |
-
" (nsfw:3), (nude:3), (uncensored:3), (nsfl:3), (gore:3),"
|
| 47 |
-
" (erotic:3), (provocative:3), (suggestive:3), (seductive:3),"
|
| 48 |
-
" (cleavage:3), (thighs:2), (underboob:3),"
|
| 49 |
-
" (nsfw:3, nude:3, erotic:3, sexual:3, explicit:3, uncensored:3)"
|
| 50 |
-
)
|
| 51 |
-
|
| 52 |
-
# --- Seeds ---
|
| 53 |
if randomize_seed:
|
| 54 |
seed = random.randint(0, MAX_SEED)
|
| 55 |
|
| 56 |
generator = torch.Generator().manual_seed(seed)
|
| 57 |
|
| 58 |
-
# --- Generate image ---
|
| 59 |
image = pipe(
|
| 60 |
prompt=prompt,
|
| 61 |
negative_prompt=negative_prompt,
|
|
@@ -104,8 +88,8 @@ with gr.Blocks(css=css) as demo:
|
|
| 104 |
label="Negative prompt",
|
| 105 |
max_lines=1,
|
| 106 |
placeholder="Enter a negative prompt",
|
| 107 |
-
value = "(low quality, worst quality:1.2), very displeasing, 3d, watermark, signature, ugly, poorly drawn",
|
| 108 |
-
visible=
|
| 109 |
)
|
| 110 |
|
| 111 |
seed = gr.Slider(
|
|
@@ -141,7 +125,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 141 |
minimum=0.0,
|
| 142 |
maximum=10.0,
|
| 143 |
step=0.1,
|
| 144 |
-
value=
|
| 145 |
)
|
| 146 |
|
| 147 |
num_inference_steps = gr.Slider(
|
|
@@ -149,7 +133,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 149 |
minimum=1,
|
| 150 |
maximum=50,
|
| 151 |
step=1,
|
| 152 |
-
value=
|
| 153 |
)
|
| 154 |
|
| 155 |
gr.Examples(examples=examples, inputs=[prompt])
|
|
|
|
| 35 |
num_inference_steps,
|
| 36 |
progress=gr.Progress(track_tqdm=True),
|
| 37 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
if randomize_seed:
|
| 39 |
seed = random.randint(0, MAX_SEED)
|
| 40 |
|
| 41 |
generator = torch.Generator().manual_seed(seed)
|
| 42 |
|
|
|
|
| 43 |
image = pipe(
|
| 44 |
prompt=prompt,
|
| 45 |
negative_prompt=negative_prompt,
|
|
|
|
| 88 |
label="Negative prompt",
|
| 89 |
max_lines=1,
|
| 90 |
placeholder="Enter a negative prompt",
|
| 91 |
+
value = "(low quality, worst quality:1.2), very displeasing, 3d, watermark, signature, ugly, poorly drawn, (breasts:3), (nipple:3), (nipples:3), (boobs:3), (butt:3), (ass:3), (butthole:3), (sex:3), (fetish:3), (pussy:3), (vagina:3), (porn:3), (hentai:3), (explicit:3)",
|
| 92 |
+
visible=False,
|
| 93 |
)
|
| 94 |
|
| 95 |
seed = gr.Slider(
|
|
|
|
| 125 |
minimum=0.0,
|
| 126 |
maximum=10.0,
|
| 127 |
step=0.1,
|
| 128 |
+
value=3.6, # Replace with defaults that work for your model
|
| 129 |
)
|
| 130 |
|
| 131 |
num_inference_steps = gr.Slider(
|
|
|
|
| 133 |
minimum=1,
|
| 134 |
maximum=50,
|
| 135 |
step=1,
|
| 136 |
+
value=15, # Replace with defaults that work for your model
|
| 137 |
)
|
| 138 |
|
| 139 |
gr.Examples(examples=examples, inputs=[prompt])
|