abidlabs HF Staff commited on
Commit
36fe290
·
verified ·
1 Parent(s): c76c4a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -35
app.py CHANGED
@@ -56,33 +56,9 @@ def single_condition_generate_image(prompt, spatial_img, height, width, seed, co
56
  # Define the Gradio interface components
57
  control_types = ["Ghibli"]
58
 
59
- # Example data
60
- single_examples = [
61
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/00.png"), 680, 1024, 5, "Ghibli", True, 1],
62
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/02.png"), 560, 1024, 42, "Ghibli", False, 0],
63
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/03.png"), 568, 1024, 1, "Ghibli", False, 0],
64
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/04.png"), 768, 672, 1, "Ghibli", False, 0],
65
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/06.png"), 896, 1024, 1, "Ghibli", False, 0],
66
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/07.png"), 528, 800, 1, "Ghibli", False, 0],
67
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/08.png"), 696, 1024, 1, "Ghibli", False, 0],
68
- ["Ghibli Studio style, Charming hand-drawn anime-style illustration", Image.open("./test_imgs/09.png"), 896, 1024, 1, "Ghibli", False, 0],
69
- ]
70
-
71
 
72
  # Create the Gradio Blocks interface
73
  with gr.Blocks() as demo:
74
- gr.Markdown("# Ghibli Studio Control Image Generation with EasyControl")
75
- gr.Markdown("The model is trained on **only 100 real Asian faces** paired with **GPT-4o-generated Ghibli-style counterparts**, and it preserves facial features while applying the iconic anime aesthetic.")
76
- gr.Markdown("Generate images using EasyControl with Ghibli control LoRAs.(Due to hardware constraints, only low-resolution images can be generated. For high-resolution (1024+), please set up your own environment.)")
77
-
78
- gr.Markdown("**[Attention!!]**:The recommended prompts for using Ghibli Control LoRA should include the trigger words: `Ghibli Studio style, Charming hand-drawn anime-style illustration`. You can also add some detailed descriptions for better results.")
79
-
80
- gr.Markdown("[UPDATE 20250411]:The training code of EasyControl has been released (github: [EasyControl](https://github.com/Xiaojiu-z/EasyControl/tree/main/train))! Happy building your own Ghibli model.")
81
-
82
- gr.Markdown("[UPDATE 20250407]:CFG Zero* (github: [CFG-Zero*](https://github.com/WeichenFan/CFG-Zero-star)) has been integrated into this demo. Try it out by checking the box.")
83
-
84
- gr.Markdown("😊😊If you like this demo, please give us a star (github: [EasyControl](https://github.com/Xiaojiu-z/EasyControl))")
85
-
86
  with gr.Tab("Ghibli Condition Generation"):
87
  with gr.Row():
88
  with gr.Column():
@@ -99,16 +75,6 @@ with gr.Blocks() as demo:
99
  with gr.Column():
100
  single_output_image = gr.Image(label="Generated Image")
101
 
102
- # Add examples for Single Condition Generation
103
- gr.Examples(
104
- examples=single_examples,
105
- inputs=[prompt, spatial_img, height, width, seed, control_type, use_zero_init, zero_steps],
106
- outputs=single_output_image,
107
- fn=single_condition_generate_image,
108
- cache_examples=False, # 缓存示例结果以加快加载速度
109
- label="Single Condition Examples"
110
- )
111
-
112
  # Link the buttons to the functions
113
  single_generate_btn.click(
114
  single_condition_generate_image,
@@ -117,4 +83,4 @@ with gr.Blocks() as demo:
117
  )
118
 
119
  # Launch the Gradio app
120
- demo.queue().launch()
 
56
  # Define the Gradio interface components
57
  control_types = ["Ghibli"]
58
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  # Create the Gradio Blocks interface
61
  with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
 
 
 
62
  with gr.Tab("Ghibli Condition Generation"):
63
  with gr.Row():
64
  with gr.Column():
 
75
  with gr.Column():
76
  single_output_image = gr.Image(label="Generated Image")
77
 
 
 
 
 
 
 
 
 
 
 
78
  # Link the buttons to the functions
79
  single_generate_btn.click(
80
  single_condition_generate_image,
 
83
  )
84
 
85
  # Launch the Gradio app
86
+ demo.launch()