import gradio as gr from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler import torch def imagen(inputs): model_id = "Fazzie/PokemonGAI" # Use the DPMSolverMultistepScheduler (DPM-Solver++) scheduler here instead pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config) if torch.cuda.is_available(): pipe = pipe.to("cuda") prompt = "a photo of an astronaut riding a horse on mars" negative_prompt = 'pixelated, distorted' image = pipe(prompt=inputs, negative_prompt=negative_prompt).images[0] return image demo = gr.Interface(fn=imagen, inputs="text", outputs="image") demo.launch() # gr.Interface.load("models/Fazzie/PokemonGAI").launch()