File size: 913 Bytes
b60a54e
 
 
54ef56a
 
b60a54e
54ef56a
 
 
d13afd7
54ef56a
 
 
 
 
d13afd7
54ef56a
3b42df3
54ef56a
 
 
 
 
5e69d3c
 
54ef56a
 
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
26
27
import os
import random
import gradio as gr
import torch
from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("fluently/Fluently-XL-Final")
pipe.load_lora_weights("OEvortex/HelpingAI-PixelCraft")
pipe.to("cuda" if torch.cuda.is_available() else "cpu")

# Function to generate image from prompt
def generate_image(prompt):
    # Use the pipeline to generate an image from the text prompt
    image = pipe(prompt).images[0]
    return image

# Create Gradio interface
iface = gr.Interface(
    fn=generate_image,                # Function that generates the image
    inputs=gr.Textbox(lines=2, placeholder="Enter your prompt"),  # Textbox input for the prompt
    outputs="image",                  # Output is an image
    title="Kwai-Kolors Image Generator",
    description="Generate images from text prompts using the Kwai-Kolors diffusion model."
)

# Launch the app
iface.launch()