angtrim's picture
nuova interfaccia
fb624fd
raw
history blame
1.11 kB
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, scale, steps, seed):
generator = torch.Generator(device=device).manual_seed(seed)
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=steps, guidance_scale=scale, 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)