File size: 1,054 Bytes
8f81762 a6a9a80 5d63e55 a6a9a80 |
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 |
import spaces
import gradio as gr
from functools import partial
from makeanime.cli import main
generate_image = spaces.GPU(partial(main, is_gradio=True), duration=120)
with gr.Blocks() as demo:
gr.Markdown("# makeanime: Turn your image into an anime")
with gr.Row():
with gr.Column():
image_input = gr.Image(label="Upload your image")
prompt_input = gr.Text(label="Prompt")
style_weight_slider = gr.Slider(
label="Style Weight", minimum=0.0, maximum=1.0, value=0.5, step=0.1
)
face_weight_slider = gr.Slider(
label="Face Weight", minimum=0.0, maximum=1.0, value=0.5, step=0.1
)
generate_button = gr.Button("Generate Anime Image")
with gr.Column():
result_output = gr.Image()
generate_button.click(
fn=generate_image,
inputs=[image_input, prompt_input, style_weight_slider, face_weight_slider],
outputs=result_output,
)
if __name__ == "__main__":
demo.launch()
|