File size: 2,782 Bytes
17e58be
77efc8c
96ad892
945386e
 
 
77efc8c
3a1878a
 
 
 
 
 
 
 
c7b40e1
 
 
3a1878a
 
c7b40e1
945386e
14863c2
945386e
 
 
 
c7b40e1
945386e
14863c2
945386e
 
 
 
190c4ad
945386e
14863c2
945386e
 
 
 
c7b40e1
0389d06
945386e
 
 
 
 
0389d06
945386e
3a1878a
0389d06
945386e
 
 
 
 
 
25cb0a6
945386e
0389d06
146f57d
c7b40e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import gradio as gr


model_1 = gr.load("models/pimpilikipilapi1/NSFW_master")
model_2 = gr.load("models/DiegoJR1973/NSFW-TrioHMH-Flux")
model_3 = gr.load("models/prashanth970/flux-lora-uncensored")


default_negative_prompt = (
    "Extra limbs, Extra fingers or toes, Disfigured face, Distorted hands, Mutated body parts, "
    "Missing limbs, Asymmetrical features, Blurry face, Poor anatomy, Incorrect proportions, Crooked eyes, "
    "Deformed hands or fingers, Double face, Unrealistic skin texture, Overly smooth skin, Poor lighting, "
    "Cartoonish appearance, Plastic look, Grainy, Unnatural expressions, Crossed eyes, Mutated clothing, "
    "Artifacts, Uncanny valley, Doll-like features, Bad symmetry, Uneven skin tones, Extra teeth, "
    "Unrealistic hair texture, Dark shadows on face, Overexposed face, Cluttered background, Text, watermark, "
    "or signature, Over-processed, Low quality, Blurry, Low resolution, Pixelated, Oversaturated, Too dark, Overexposed, Poor lighting, "
    "Unclear, Text or watermark, Distorted faces, Extra limbs or fingers, Disfigured, Grainy, Overly stylized, Cartoonish, "
    "Unrealistic anatomy, Bad proportions, Unrealistic colors, Artificial look, Background noise, Unwanted objects, Repetitive patterns, Artifacting, Abstract shapes, Out of focus"
)


def generate_image_model_1(prompt, negative_prompt):
    prompt += " 2k"
    try:
        return model_1(prompt, negative_prompt=negative_prompt)
    except TypeError:
        return model_1(prompt)

def generate_image_model_2(prompt, negative_prompt):
    prompt += " 8k"
    try:
        return model_2(prompt, negative_prompt=negative_prompt)
    except TypeError:
        return model_2(prompt)

def generate_image_model_3(prompt, negative_prompt):
    prompt += " 10k"
    try:
        return model_3(prompt, negative_prompt=negative_prompt)
    except TypeError:
        return model_3(prompt)

interface = gr.Interface(
    fn=lambda prompt, negative_prompt: (
        generate_image_model_1(prompt, negative_prompt),
        generate_image_model_2(prompt, negative_prompt),
        generate_image_model_3(prompt, negative_prompt)
    ),
    inputs=[
        gr.Textbox(label="Type your prompt here: ✍️", placeholder="Describe what you want..."),
        gr.Textbox(label="Negative prompt:", value=default_negative_prompt),
    ],
    outputs=[
        gr.Image(label="Generated Image - Model 1"),
        gr.Image(label="Generated Image - Model 2"),
        gr.Image(label="Generated Image - Model 3"),
    ],
    title="Text to Image (NSFW) πŸ”ž",
    theme="NoCrypt/miku",
    description="⚠️ Sorry for the inconvenience. The model is currently running on the CPU, which might affect performance. We appreciate your understanding.",
)

interface.launch()