|
import gradio as gr |
|
import random |
|
|
|
model = gr.load("models/prithivMLmods/SD3.5-Turbo-Realism-2.0-LoRA") |
|
|
|
def generate_image(text, seed): |
|
if seed is not None: |
|
random.seed(seed) |
|
|
|
if text in [example[0] for example in examples]: |
|
print(f"Using example: {text}") |
|
|
|
return model(text) |
|
|
|
examples = [ |
|
["Humanoid Cat Warrior, Full View", None], |
|
["Warhammer Sisterhood", None], |
|
["Future Robots war", None], |
|
["Fantasy dragon", None] |
|
] |
|
|
|
interface = gr.Interface( |
|
fn=generate_image, |
|
inputs=[ |
|
gr.Textbox(label="Type here your imagination:", placeholder="Type or click an example..."), |
|
gr.Slider(minimum=0, maximum=10000, step=1, label="Seed (optional)") |
|
], |
|
outputs=gr.Image(label="Generated Image"), |
|
examples=examples, |
|
theme="NoCrypt/miku", |
|
description="Sorry for the inconvenience. The model is currently running on the CPU, which might affect performance. We appreciate your understanding.", |
|
) |
|
|
|
interface.launch() |