Spaces:
Runtime error
Runtime error
File size: 2,356 Bytes
6bf9055 58bc76b 79a4da9 c1a44e4 3303193 c1a44e4 477d98a 2686f9b c1a44e4 58bc76b 7db52d8 58bc76b c1a44e4 9e309e0 c1a44e4 58bc76b 6bf9055 6bf23d3 6bf9055 79a4da9 6bf9055 79a4da9 6bf9055 58bc76b 6bf9055 58bc76b 6bf23d3 58bc76b 6bf9055 58bc76b 7db52d8 58bc76b 6bf9055 58bc76b |
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
import gradio as gr
from optimum.intel import OVStableDiffusionPipeline
model_id = "helenai/eimiss-EimisAnimeDiffusion_1.0v-ov"
batch_size = 1
num_images_per_prompt = 1
height = 512
width = 512
pipeline = OVStableDiffusionPipeline.from_pretrained(model_id, compile=False)
pipeline.sampler = "dpm++2s_a"
pipeline.to("CPU")
pipeline.reshape( batch_size=batch_size, height=height, width=width, num_images_per_prompt=num_images_per_prompt)
pipeline.compile()
def infer(prompt):
image = pipeline(
prompt=prompt,
width=width,
height=height,
num_inference_steps=28,
num_images_per_prompt=num_images_per_prompt,
).images[0]
return image
examples = [
"Sailor Chibi Moon, Katsura Masakazu style",
"1girl, silver hair, symbol-shaped pupils, yellow eyes, smiling, light particles, light rays, wallpaper, star guardian, serious face, red inner hair, power aura, grandmaster1, golden and white clothes",
"A cute kitten, Tinkle style.",
"(illustration, 8k CG, extremely detailed),(whimsical),catgirl,teenage girl,playing in the snow,winter wonderland,snow-covered trees,soft pastel colors,gentle lighting,sparkling snow,joyful,magical atmosphere,highly detailed,fluffy cat ears and tail,intricate winter clothing,shallow depth of field,watercolor techniques,close-up shot,slightly tilted angle,fairy tale architecture,nostalgic,playful,winter magic,(masterpiece:2),best quality,ultra highres,original,extremely detailed,perfect lighting,",
]
css = """
#col-container {
margin: 0 auto;
max-width: 520px;
}
"""
with gr.Blocks(css=css) as demo:
with gr.Column(elem_id="col-container"):
gr.Markdown("# Demo : helenai/eimiss-EimisAnimeDiffusion_1.0v-ov ⚡")
with gr.Row():
prompt = gr.Text(
label="Prompt",
show_label=False,
placeholder="Enter your prompt",
container=False,
)
run_button = gr.Button("Run", scale=0)
result = gr.Image(label="Result", show_label=False)
gr.Examples(
examples = examples,
fn = infer,
inputs = [prompt],
outputs = [result]
)
run_button.click(
fn=infer,
inputs=[prompt],
outputs=[result]
)
demo.queue().launch(share=True)
|