| import gradio as gr |
| from diffusers import DiffusionPipeline |
| import torch |
|
|
| pipe = DiffusionPipeline.from_pretrained( |
| "AMRDIAB20/sd15-charify-merged" |
| ) |
|
|
| def generate(prompt, guidance): |
| image = pipe( |
| prompt, |
| num_inference_steps=30, |
| guidance_scale=guidance, |
| height=512, |
| width=512 |
| ).images[0] |
| return image |
|
|
| gr.Interface( |
| fn=generate, |
| inputs=[ |
| gr.Textbox(label="Prompt", value="Charify-style, cartoon character"), |
| gr.Slider(1.0, 12.0, value=7.5, label="Guidance Scale") |
| ], |
| outputs=gr.Image(type="pil"), |
| title="Charify-style, cartoon character", |
| description="Charify-style, cartoon character, using the merged Charify LoRA model." |
| ).launch() |
|
|