File size: 1,083 Bytes
fcad6de
fb624fd
 
 
 
 
fcad6de
fb624fd
fcad6de
fb624fd
 
 
f13d354
7ad81df
fb624fd
 
f13d354
fb624fd
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
import torch
import numpy as np
import modin.pandas as pd
from PIL import Image
from diffusers import DiffusionPipeline

device = "cuda" if torch.cuda.is_available() else "cpu"

pipe = DiffusionPipeline.from_pretrained("krnl/venereital-IA-23", safety_checker=None)
pipe = pipe.to(device)

def genie (prompt, negative_prompt):
     generator = torch.Generator(device=device).manual_seed(-1)
     prompt = "photo of sks person, " + prompt
     negative_prompt = "nude, naked, tits, nsfw, " + negative_prompt
     images = pipe(prompt, negative_prompt=negative_prompt, width=512, height=512, num_inference_steps=25, guidance_scale=7, num_images_per_prompt=1, generator=generator).images[0]
     return images
    
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)