Update app.py
Browse files
app.py
CHANGED
@@ -4,22 +4,28 @@
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
7 |
model1 = gr.load("models/pimpilikipilapi1/NSFW_master")
|
8 |
model2 = gr.load("models/prashanth970/flux-lora-uncensored")
|
9 |
|
10 |
-
|
11 |
-
def generate_image(text, selected_model):
|
12 |
if selected_model == "Model 1 (NSFW Master)":
|
13 |
-
|
14 |
elif selected_model == "Model 2 (Flux Lora Uncensored)":
|
15 |
-
|
16 |
else:
|
17 |
return "Invalid model selection."
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
interface = gr.Interface(
|
22 |
-
fn=
|
23 |
inputs=[
|
24 |
gr.Textbox(label="Type here your imagination:", placeholder="Type your prompt..."),
|
25 |
gr.Radio(
|
@@ -28,9 +34,13 @@ interface = gr.Interface(
|
|
28 |
value="Model 1 (NSFW Master)",
|
29 |
),
|
30 |
],
|
31 |
-
outputs=
|
|
|
|
|
|
|
|
|
32 |
theme="Yntec/HaleyCH_Theme_Orange",
|
33 |
-
description="Sorry for the inconvenience. The models are currently running on the CPU, which might affect performance. We appreciate your understanding.",
|
34 |
)
|
35 |
|
36 |
interface.launch()
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
7 |
+
|
8 |
model1 = gr.load("models/pimpilikipilapi1/NSFW_master")
|
9 |
model2 = gr.load("models/prashanth970/flux-lora-uncensored")
|
10 |
|
11 |
+
def generate_images(text, selected_model):
|
|
|
12 |
if selected_model == "Model 1 (NSFW Master)":
|
13 |
+
model = model1
|
14 |
elif selected_model == "Model 2 (Flux Lora Uncensored)":
|
15 |
+
model = model2
|
16 |
else:
|
17 |
return "Invalid model selection."
|
18 |
+
|
19 |
+
results = []
|
20 |
+
for i in range(3):
|
21 |
+
modified_text = f"{text} variation {i+1}"
|
22 |
+
result = model(modified_text)
|
23 |
+
results.append(result)
|
24 |
+
|
25 |
+
return results
|
26 |
|
27 |
interface = gr.Interface(
|
28 |
+
fn=generate_images,
|
29 |
inputs=[
|
30 |
gr.Textbox(label="Type here your imagination:", placeholder="Type your prompt..."),
|
31 |
gr.Radio(
|
|
|
34 |
value="Model 1 (NSFW Master)",
|
35 |
),
|
36 |
],
|
37 |
+
outputs=[
|
38 |
+
gr.Image(label="Generated Image 1"),
|
39 |
+
gr.Image(label="Generated Image 2"),
|
40 |
+
gr.Image(label="Generated Image 3"),
|
41 |
+
],
|
42 |
theme="Yntec/HaleyCH_Theme_Orange",
|
43 |
+
description="⚠ Sorry for the inconvenience. The models are currently running on the CPU, which might affect performance. We appreciate your understanding.",
|
44 |
)
|
45 |
|
46 |
interface.launch()
|