Skip to content

Commit

Permalink
Merge pull request #32 from jkremser/safe_checker_logic
Browse files Browse the repository at this point in the history
stable-diff: safety checker (negating the condition)
  • Loading branch information
jkremser authored Jun 19, 2024
2 parents decc812 + 5f7e0a6 commit 73a2931
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/stable-diffusion/webui/app/prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export const Prompt: React.FC<PromptProps> = ({ sendToQ }) => {
},
});
const safetyCheck = (prompt: string) => {
const stopList = ["boobs", "tits", "vagina", "penis", "dick", "naked", "nude", "fuck", "coitus", "sex", "shit", "blood", "murder", "dead"];
const stopList = ["boob", "tits", "vagina", "penis", "dick", "naked", "nude", "fuck", "coitus", "sex", "shit", "blood", "murder", "dead"];
return stopList.some(w => prompt.toLowerCase().includes(w));
}

const generateOnClick = () => {
if (prompt) {
if (!safetyCheck(prompt)) {
if (safetyCheck(prompt)) {
toast.warning("Please don't use this tool for creating NSFW content.");
focusPrompt();
return
Expand Down

0 comments on commit 73a2931

Please sign in to comment.