Spaces:
Runtime error
Runtime error
from diffusers import DiffusionPipeline | |
import torch | |
import gradio as gr | |
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float32, use_safetensors=True, variant="fp16") | |
pipe.to("cpu") # Note the change here | |
def generate_image(prompt): | |
images = pipe(prompt='an highly detailed , highly realistic'+prompt).images[0] | |
return images | |
iface = gr.Interface(fn=generate_image, inputs="text", outputs="image") | |
iface.launch() | |