vinesmsuic commited on
Commit
c02796a
1 Parent(s): da4c013
Files changed (2) hide show
  1. app.py +5 -4
  2. app_cosxl.py → app_ip2p.py +4 -5
app.py CHANGED
@@ -14,7 +14,8 @@ from PIL import Image
14
  import torch
15
  import numpy as np
16
 
17
- from black_box_image_edit.instructpix2pix import InstructPix2Pix
 
18
  from prepare_video import crop_and_resize_video
19
  from edit_image import infer_video
20
 
@@ -40,7 +41,7 @@ demo_examples = [
40
  TEMP_DIR = "_demo_temp"
41
 
42
 
43
- image_edit_model = InstructPix2Pix()
44
 
45
  @torch.no_grad()
46
  @spaces.GPU(duration=30)
@@ -315,7 +316,7 @@ with gr.Blocks() as demo:
315
  gr.Markdown("Official 🤗 Gradio demo for [AnyV2V: A Plug-and-Play Framework For Any Video-to-Video Editing Tasks](https://tiger-ai-lab.github.io/AnyV2V/)")
316
 
317
  with gr.Tabs():
318
- with gr.TabItem('AnyV2V(I2VGenXL) + InstructPix2Pix'):
319
  gr.Markdown("# Preprocessing Video Stage")
320
  gr.Markdown("In this demo, AnyV2V only support video with 2 seconds duration and 8 fps. If your video is not in this format, we will preprocess it for you. Click on the Preprocess video button!")
321
  with gr.Row():
@@ -339,7 +340,7 @@ with gr.Blocks() as demo:
339
  pv_longest_to_width = gr.Checkbox(label="Resize Longest Dimension to Width")
340
 
341
  gr.Markdown("# Image Editing Stage")
342
- gr.Markdown("Edit the first frame of the video to your liking! Click on the Edit the first frame button after inputting the editing instruction prompt. This image editing stage is powered by InstructPix2Pix. You can try edit the image multiple times until you are happy with the result! You can also choose to download the first frame of the video and edit it with other software (e.g. Photoshop, GIMP, etc.) or use other image editing models to obtain the edited frame and upload it directly.")
343
  with gr.Row():
344
  with gr.Column():
345
  src_first_frame = gr.Image(label="First Frame", type="filepath", interactive=False)
 
14
  import torch
15
  import numpy as np
16
 
17
+ from black_box_image_edit.cosxl_edit import CosXLEdit
18
+ #from black_box_image_edit.instructpix2pix import InstructPix2Pix
19
  from prepare_video import crop_and_resize_video
20
  from edit_image import infer_video
21
 
 
41
  TEMP_DIR = "_demo_temp"
42
 
43
 
44
+ image_edit_model = CosXLEdit()
45
 
46
  @torch.no_grad()
47
  @spaces.GPU(duration=30)
 
316
  gr.Markdown("Official 🤗 Gradio demo for [AnyV2V: A Plug-and-Play Framework For Any Video-to-Video Editing Tasks](https://tiger-ai-lab.github.io/AnyV2V/)")
317
 
318
  with gr.Tabs():
319
+ with gr.TabItem('AnyV2V(I2VGenXL) + CosXLEdit'):
320
  gr.Markdown("# Preprocessing Video Stage")
321
  gr.Markdown("In this demo, AnyV2V only support video with 2 seconds duration and 8 fps. If your video is not in this format, we will preprocess it for you. Click on the Preprocess video button!")
322
  with gr.Row():
 
340
  pv_longest_to_width = gr.Checkbox(label="Resize Longest Dimension to Width")
341
 
342
  gr.Markdown("# Image Editing Stage")
343
+ gr.Markdown("Edit the first frame of the video to your liking! Click on the Edit the first frame button after inputting the editing instruction prompt. This image editing stage is powered by CosXLEdit. You can try edit the image multiple times until you are happy with the result! You can also choose to download the first frame of the video and edit it with other software (e.g. Photoshop, GIMP, etc.) or use other image editing models to obtain the edited frame and upload it directly.")
344
  with gr.Row():
345
  with gr.Column():
346
  src_first_frame = gr.Image(label="First Frame", type="filepath", interactive=False)
app_cosxl.py → app_ip2p.py RENAMED
@@ -14,8 +14,7 @@ from PIL import Image
14
  import torch
15
  import numpy as np
16
 
17
- from black_box_image_edit.cosxl_edit import CosXLEdit
18
- #from black_box_image_edit.instructpix2pix import InstructPix2Pix
19
  from prepare_video import crop_and_resize_video
20
  from edit_image import infer_video
21
 
@@ -41,7 +40,7 @@ demo_examples = [
41
  TEMP_DIR = "_demo_temp"
42
 
43
 
44
- image_edit_model = CosXLEdit()
45
 
46
  @torch.no_grad()
47
  @spaces.GPU(duration=30)
@@ -316,7 +315,7 @@ with gr.Blocks() as demo:
316
  gr.Markdown("Official 🤗 Gradio demo for [AnyV2V: A Plug-and-Play Framework For Any Video-to-Video Editing Tasks](https://tiger-ai-lab.github.io/AnyV2V/)")
317
 
318
  with gr.Tabs():
319
- with gr.TabItem('AnyV2V(I2VGenXL) + CosXLEdit'):
320
  gr.Markdown("# Preprocessing Video Stage")
321
  gr.Markdown("In this demo, AnyV2V only support video with 2 seconds duration and 8 fps. If your video is not in this format, we will preprocess it for you. Click on the Preprocess video button!")
322
  with gr.Row():
@@ -340,7 +339,7 @@ with gr.Blocks() as demo:
340
  pv_longest_to_width = gr.Checkbox(label="Resize Longest Dimension to Width")
341
 
342
  gr.Markdown("# Image Editing Stage")
343
- gr.Markdown("Edit the first frame of the video to your liking! Click on the Edit the first frame button after inputting the editing instruction prompt. This image editing stage is powered by CosXLEdit. You can try edit the image multiple times until you are happy with the result! You can also choose to download the first frame of the video and edit it with other software (e.g. Photoshop, GIMP, etc.) or use other image editing models to obtain the edited frame and upload it directly.")
344
  with gr.Row():
345
  with gr.Column():
346
  src_first_frame = gr.Image(label="First Frame", type="filepath", interactive=False)
 
14
  import torch
15
  import numpy as np
16
 
17
+ from black_box_image_edit.instructpix2pix import InstructPix2Pix
 
18
  from prepare_video import crop_and_resize_video
19
  from edit_image import infer_video
20
 
 
40
  TEMP_DIR = "_demo_temp"
41
 
42
 
43
+ image_edit_model = InstructPix2Pix()
44
 
45
  @torch.no_grad()
46
  @spaces.GPU(duration=30)
 
315
  gr.Markdown("Official 🤗 Gradio demo for [AnyV2V: A Plug-and-Play Framework For Any Video-to-Video Editing Tasks](https://tiger-ai-lab.github.io/AnyV2V/)")
316
 
317
  with gr.Tabs():
318
+ with gr.TabItem('AnyV2V(I2VGenXL) + InstructPix2Pix'):
319
  gr.Markdown("# Preprocessing Video Stage")
320
  gr.Markdown("In this demo, AnyV2V only support video with 2 seconds duration and 8 fps. If your video is not in this format, we will preprocess it for you. Click on the Preprocess video button!")
321
  with gr.Row():
 
339
  pv_longest_to_width = gr.Checkbox(label="Resize Longest Dimension to Width")
340
 
341
  gr.Markdown("# Image Editing Stage")
342
+ gr.Markdown("Edit the first frame of the video to your liking! Click on the Edit the first frame button after inputting the editing instruction prompt. This image editing stage is powered by InstructPix2Pix. You can try edit the image multiple times until you are happy with the result! You can also choose to download the first frame of the video and edit it with other software (e.g. Photoshop, GIMP, etc.) or use other image editing models to obtain the edited frame and upload it directly.")
343
  with gr.Row():
344
  with gr.Column():
345
  src_first_frame = gr.Image(label="First Frame", type="filepath", interactive=False)