File size: 822 Bytes
506e749
 
 
7979503
ac65298
 
506e749
7979503
506e749
7979503
 
506e749
7979503
afebdf8
7979503
506e749
7979503
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
from diffusers import DiffusionPipeline

# Initialize the DiffusionPipeline with the specified model
pipeline = DiffusionPipeline.from_pretrained("Lykon/dreamshaper-7")
pipeline.load_lora_weights("openskyml/midjourney-v4-xl")

# Function to generate image based on the prompt
def generate_image(prompt):
    image = pipeline(prompt).images[0]
    return image

# Define the Gradio interface layout
prompt_input = gr.Textbox(label="", placeholder="Enter your prompt here...", lines=1)
image_output = gr.Image(label="Generated Image")

# Create the Gradio interface with a more organized layout
gr.Interface(
    fn=generate_image,
    title="OpenJourney Image Generation",
    theme="compact",  # Use a more compact theme for the interface
    inputs=[prompt_input],
    outputs=image_output
).launch()