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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -28,8 +28,15 @@ def clear_cache(transformer):
28
 
29
  # Define the Gradio interface
30
  @spaces.GPU()
31
- def single_condition_generate_image(prompt, spatial_img, height, width, seed, control_type, use_zero_init, zero_steps):
32
  # Set the control type
 
 
 
 
 
 
 
33
  if control_type == "Ghibli":
34
  lora_path = os.path.join(lora_base_path, "Ghibli.safetensors")
35
  set_single_lora(pipe.transformer, lora_path, lora_weights=[1], cond_size=512)
@@ -62,14 +69,7 @@ with gr.Blocks() as demo:
62
  with gr.Tab("Ghibli Condition Generation"):
63
  with gr.Row():
64
  with gr.Column():
65
- prompt = gr.Textbox(label="Prompt", value="Ghibli Studio style, Charming hand-drawn anime-style illustration")
66
  spatial_img = gr.Image(label="Ghibli Image", type="pil") # 上传图像文件
67
- height = gr.Slider(minimum=256, maximum=1024, step=64, label="Height", value=768)
68
- width = gr.Slider(minimum=256, maximum=1024, step=64, label="Width", value=768)
69
- seed = gr.Number(label="Seed", value=42)
70
- control_type = gr.Dropdown(choices=control_types, label="Control Type")
71
- use_zero_init = gr.Checkbox(label="Use CFG zero star", value=False)
72
- zero_steps = gr.Number(label="Zero Init Steps", value=1)
73
  single_generate_btn = gr.Button("Generate Image")
74
 
75
  with gr.Column():
@@ -78,7 +78,7 @@ with gr.Blocks() as demo:
78
  # Link the buttons to the functions
79
  single_generate_btn.click(
80
  single_condition_generate_image,
81
- inputs=[prompt, spatial_img, height, width, seed, control_type, use_zero_init, zero_steps],
82
  outputs=single_output_image
83
  )
84
 
 
28
 
29
  # Define the Gradio interface
30
  @spaces.GPU()
31
+ def single_condition_generate_image(spatial_img, , , ):
32
  # Set the control type
33
+ prompt = "Ghibli Studio style, Charming hand-drawn anime-style illustration"
34
+ use_zero_init = False
35
+ zero_steps = 1
36
+ control_type = "Ghibli"
37
+ height = 768
38
+ width = 768
39
+ seed = 42
40
  if control_type == "Ghibli":
41
  lora_path = os.path.join(lora_base_path, "Ghibli.safetensors")
42
  set_single_lora(pipe.transformer, lora_path, lora_weights=[1], cond_size=512)
 
69
  with gr.Tab("Ghibli Condition Generation"):
70
  with gr.Row():
71
  with gr.Column():
 
72
  spatial_img = gr.Image(label="Ghibli Image", type="pil") # 上传图像文件
 
 
 
 
 
 
73
  single_generate_btn = gr.Button("Generate Image")
74
 
75
  with gr.Column():
 
78
  # Link the buttons to the functions
79
  single_generate_btn.click(
80
  single_condition_generate_image,
81
+ inputs=[spatial_img],
82
  outputs=single_output_image
83
  )
84