Spaces:
Runtime error
Runtime error
File size: 537 Bytes
189f0af 7129072 189f0af 7383dff 189f0af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import gradio as gr
from diffusers import StableDiffusionPipeline
import torch
model_id = "prompthero/openjourney"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
def generate_image(prompt):
image = pipe(prompt).images[0]
return image
iface = gr.Interface(
fn=generate_image,
inputs=gr.Textbox(prompt="Enter a prompt:"),
outputs=gr.Image(),
title="Image Generation Model",
description="Generate images from text prompts using the OpenJourney model.",
)
iface.launch()
|