File size: 1,386 Bytes
17e58be
77efc8c
625e1fa
3aec09f
 
 
625e1fa
3aec09f
83b2200
3aec09f
 
 
 
f5bddfa
2686b39
 
 
 
83b2200
 
 
 
 
 
 
 
3aec09f
0862982
f5bddfa
0389d06
3aec09f
0389d06
3aec09f
0389d06
945386e
3aec09f
 
 
945386e
2686b39
3aec09f
0389d06
146f57d
83b2200
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
import gradio as gr


model1 = gr.load("models/pimpilikipilapi1/NSFW_master")
model2 = gr.load("models/DiegoJR1973/NSFW-TrioHMH-Flux")
model3 = gr.load("models/prashanth970/flux-lora-uncensored")

def generate_images(text):

    result_image1 = model1(text)
    result_image2 = model2(text)
    result_image3 = model3(text)
    

    print(f"Result from model1: {type(result_image1)} - {result_image1}")
    print(f"Result from model2: {type(result_image2)} - {result_image2}")
    print(f"Result from model3: {type(result_image3)} - {result_image3}")
    
    if isinstance(result_image1, tuple):
        result_image1 = result_image1[0]
    if isinstance(result_image2, tuple):
        result_image2 = result_image2[0]
    if isinstance(result_image3, tuple):
        result_image3 = result_image3[0]
    

    return result_image1, result_image2, result_image3


interface = gr.Interface(
    fn=generate_images,
    inputs=[
        gr.Textbox(label="Type here your imagination:", placeholder="Type or click an example..."),
    ],
    outputs=[
        gr.Image(label="Model 1 Output"),
        gr.Image(label="Model 2 Output"),
        gr.Image(label="Model 3 Output")
    ],
    theme="huggingface",
    description="Sorry for the inconvenience. The model is currently running on the CPU, which might affect performance. We appreciate your understanding.",
)

interface.launch()