Commit ·
6dd4c00
1
Parent(s): 0e93213
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,10 +37,14 @@ css = """
|
|
| 37 |
"""
|
| 38 |
|
| 39 |
def generate(prompt, neg_prompt, samp_steps, cfg_scale, batch_size, seed, height, width, progress=gr.Progress(track_tqdm=True)):
|
|
|
|
| 40 |
if nsfw_filter:
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
| 44 |
if seed < 0:
|
| 45 |
seed = random.randint(1,999999)
|
| 46 |
images = pipe(
|
|
@@ -73,9 +77,6 @@ def set_base_model(base_model_id):
|
|
| 73 |
def update_pixel_ratio(num1, num2):
|
| 74 |
return [round(num1*num2/1048576,3), num1-(num1%8)]
|
| 75 |
|
| 76 |
-
def round_to_8(num):
|
| 77 |
-
return
|
| 78 |
-
|
| 79 |
examples = [
|
| 80 |
['A group of 4 students from University of Wisconsin Stout sitting at a table talking, men and women, detailed faces, focused',
|
| 81 |
'glitch, deformed, cross-eyed'],
|
|
|
|
| 37 |
"""
|
| 38 |
|
| 39 |
def generate(prompt, neg_prompt, samp_steps, cfg_scale, batch_size, seed, height, width, progress=gr.Progress(track_tqdm=True)):
|
| 40 |
+
prompt = prompt.lower()
|
| 41 |
if nsfw_filter:
|
| 42 |
+
if prompt[:10] == "krebzonide":
|
| 43 |
+
prompt = prompt[10:]
|
| 44 |
+
else:
|
| 45 |
+
for word in naughtyWords:
|
| 46 |
+
if prompt.find(word) > 0:
|
| 47 |
+
return None 58008
|
| 48 |
if seed < 0:
|
| 49 |
seed = random.randint(1,999999)
|
| 50 |
images = pipe(
|
|
|
|
| 77 |
def update_pixel_ratio(num1, num2):
|
| 78 |
return [round(num1*num2/1048576,3), num1-(num1%8)]
|
| 79 |
|
|
|
|
|
|
|
|
|
|
| 80 |
examples = [
|
| 81 |
['A group of 4 students from University of Wisconsin Stout sitting at a table talking, men and women, detailed faces, focused',
|
| 82 |
'glitch, deformed, cross-eyed'],
|