Skip to content

Commit

Permalink
fix: optimize gradio demo. remove unnecessary options (fudan-generati…
Browse files Browse the repository at this point in the history
…ve-vision#76)

Co-authored-by: leeway.zlw <[email protected]>
  • Loading branch information
AricGamma and AricGamma authored Jun 21, 2024
1 parent 4f99075 commit d8e2ccc
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions scripts/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,12 @@
from inference import inference_process


def predict(image, audio, size, steps, fps, cfg, pose_weight, face_weight, lip_weight, face_expand_ratio):
def predict(image, audio, pose_weight, face_weight, lip_weight, face_expand_ratio, progress=gr.Progress(track_tqdm=True)):
"""
Create a gradio interface with the configs.
"""
_ = progress
config = {
'data': {
'source_image': {
'width': size,
'height': size
},
'export_video': {
'fps': fps
}
},
'cfg_scale': cfg,
'source_image': image,
'driving_audio': audio,
'pose_weight': pose_weight,
Expand All @@ -38,8 +29,7 @@ def predict(image, audio, size, steps, fps, cfg, pose_weight, face_weight, lip_w
'face_expand_ratio': face_expand_ratio,
'config': 'configs/inference/default.yaml',
'checkpoint': None,
'output': ".cache/output.mp4",
'inference_steps': steps
'output': ".cache/output.mp4"
}
args = argparse.Namespace()
for key, value in config.items():
Expand All @@ -51,10 +41,6 @@ def predict(image, audio, size, steps, fps, cfg, pose_weight, face_weight, lip_w
inputs=[
gr.Image(label="source image (no webp)", type="filepath", format="jpeg"),
gr.Audio(label="source audio", type="filepath"),
gr.Number(label="size", value=512, minimum=256, maximum=512, step=64, precision=0),
gr.Number(label="steps", value=40, minimum=1, step=1, precision=0),
gr.Number(label="fps", value=25, minimum=1, step=1, precision=0),
gr.Slider(label="CFG Scale", value=3.5, minimum=0, maximum=10, step=0.01),
gr.Number(label="pose weight", value=1.0),
gr.Number(label="face weight", value=1.0),
gr.Number(label="lip weight", value=1.0),
Expand Down

0 comments on commit d8e2ccc

Please sign in to comment.