Spaces:
Runtime error
Runtime error
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("circulus/canvers-anime-v3.8.1", safety_checker=None) | |
pipe = pipe.to(device) | |
def genie (Prompt, negative_prompt, scale, seed): | |
generator = torch.Generator(device=device).manual_seed(seed) | |
image = pipe(Prompt, negative_prompt=negative_prompt, height=512, width=512, guidance_scale=scale, generator=generator).images[0] | |
return image | |
gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'), | |
gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'), | |
#gr.Slider(512, 768, 512, step=128, label='height'), | |
#gr.Slider(512, 768, 512, step=128, label='width'), | |
gr.Slider(1, maximum=9, value=5, step=.25), | |
#gr.Slider(1, maximum=50, value=25, step=1), | |
gr.Slider(minimum=0, step=1, maximum=9999999999999999, randomize=True, label='Seed'), | |
], | |
outputs = 'image', | |
title = 'Canvers Anime V3.8.1 - CPU', | |
description = "<b>WARNING:</b> Extremely Slow. 15s/Iteration. Expect 8-16mins. 50 iterations takes ~15mins.", | |
article = "Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=True) |