Spaces:
Runtime error
Runtime error
nuova interfaccia
Browse files
app.py
CHANGED
@@ -1,7 +1,20 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import torch
|
3 |
+
import numpy as np
|
4 |
+
import modin.pandas as pd
|
5 |
+
from PIL import Image
|
6 |
+
from diffusers import DiffusionPipeline
|
7 |
|
8 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
9 |
|
10 |
+
pipe = DiffusionPipeline.from_pretrained("krnl/venereital-IA-23", safety_checker=None)
|
11 |
+
pipe = pipe.to(device)
|
12 |
+
|
13 |
+
def genie (prompt, negative_prompt, scale, steps, seed):
|
14 |
+
generator = torch.Generator(device=device).manual_seed(seed)
|
15 |
+
prompt = "photo of sks person, " + prompt
|
16 |
+
negative_prompt = "nude, naked, tits, nsfw, " + negative_prompt
|
17 |
+
images = pipe(prompt, negative_prompt=negative_prompt, width=512, height=512, num_inference_steps=steps, guidance_scale=scale, num_images_per_prompt=1, generator=generator).images[0]
|
18 |
+
return images
|
19 |
+
|
20 |
+
gr.Interface(fn=genie, inputs=[gr.Textbox(label='Descrivi la tua venere ideale',default="capelli rossi, con occhiali da sole"), gr.Textbox(label='Descrivi cosa non vorresti vedere',default="faccia triste")], outputs='image', title="Generatore di Venere", description="Genera la tua Venere! Scatena la tua fantsIA!").launch(debug=True, max_threads=True)
|