|
import gradio as gr |
|
from diffusers import DiffusionPipeline |
|
|
|
|
|
pipeline = DiffusionPipeline.from_pretrained("John6666/t-ponynai3-v6-sdxl") |
|
|
|
def generate_image(prompt, negative_prompt): |
|
|
|
image = pipeline(prompt, negative_prompt=negative_prompt).images[0] |
|
return image |
|
|
|
|
|
with gr.Blocks() as demo: |
|
gr.Markdown("# ponynai3 v6 sdxl") |
|
|
|
with gr.Row(): |
|
with gr.Column(): |
|
prompt = gr.Textbox(label="Enter your prompt", placeholder="Describe the image you want to generate") |
|
negative_prompt = gr.Textbox(label="Enter negative prompt", placeholder="Describe what you want to avoid") |
|
generate_button = gr.Button("Generate") |
|
|
|
with gr.Column(): |
|
output_image = gr.Image(label="Generated Image") |
|
|
|
generate_button.click(fn=generate_image, inputs=[prompt, negative_prompt], outputs=output_image) |
|
|
|
|
|
demo.launch() |
|
|