Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,6 +16,13 @@ API_URL_DEV = "https://api-inference.huggingface.co/models/black-forest-labs/FLU
|
|
16 |
API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell"
|
17 |
timeout = 100
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
def enhance_prompt(prompt, model="mistralai/Mistral-7B-Instruct-v0.1", style="photo-realistic"):
|
20 |
|
21 |
client = Client("K00B404/Mistral-Nemo-custom")
|
@@ -111,7 +118,7 @@ def query(prompt, is_negative=False, steps=30, cfg_scale=7, sampler="DPM++ 2M Ka
|
|
111 |
return None, None, None
|
112 |
|
113 |
key = random.randint(0, 999)
|
114 |
-
|
115 |
#prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
116 |
print(f'\033[1mGeneration {key} translation:\033[0m {prompt}')
|
117 |
|
|
|
16 |
API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell"
|
17 |
timeout = 100
|
18 |
|
19 |
+
def check_ubuse(prompt,word_list=["little girl"]):
|
20 |
+
for word in word_list:
|
21 |
+
if word in prompt:
|
22 |
+
print(f"Abuse! prompt {prompt} wiped!")
|
23 |
+
return "Fuck You Bastard!"
|
24 |
+
return prompt
|
25 |
+
|
26 |
def enhance_prompt(prompt, model="mistralai/Mistral-7B-Instruct-v0.1", style="photo-realistic"):
|
27 |
|
28 |
client = Client("K00B404/Mistral-Nemo-custom")
|
|
|
118 |
return None, None, None
|
119 |
|
120 |
key = random.randint(0, 999)
|
121 |
+
prompt = check_ubuse(prompt)
|
122 |
#prompt = GoogleTranslator(source='ru', target='en').translate(prompt)
|
123 |
print(f'\033[1mGeneration {key} translation:\033[0m {prompt}')
|
124 |
|