Spaces:
Running
on
Zero
Running
on
Zero
app
Browse files- __pycache__/db_examples.cpython-310.pyc +0 -0
- __pycache__/demo_utils1.cpython-310.pyc +0 -0
- app.py +24 -25
- app1_rg3.py +26 -6
- misc_utils/__pycache__/flow_utils.cpython-310.pyc +0 -0
- misc_utils/__pycache__/image_utils.cpython-310.pyc +0 -0
- misc_utils/__pycache__/model_utils.cpython-310.pyc +0 -0
- misc_utils/__pycache__/train_utils.cpython-310.pyc +0 -0
- modules/openclip/__pycache__/modules.cpython-310.pyc +0 -0
- modules/video_unet_temporal/__pycache__/attention.cpython-310.pyc +0 -0
- modules/video_unet_temporal/__pycache__/motion_module.cpython-310.pyc +0 -0
- modules/video_unet_temporal/__pycache__/resnet.cpython-310.pyc +0 -0
- modules/video_unet_temporal/__pycache__/unet.cpython-310.pyc +0 -0
- modules/video_unet_temporal/__pycache__/unet_blocks.cpython-310.pyc +0 -0
- pl_trainer/__pycache__/diffusion.cpython-310.pyc +0 -0
- pl_trainer/__pycache__/instruct_p2p_video.cpython-310.pyc +0 -0
- pl_trainer/inference/__pycache__/inference.cpython-310.pyc +0 -0
__pycache__/db_examples.cpython-310.pyc
CHANGED
Binary files a/__pycache__/db_examples.cpython-310.pyc and b/__pycache__/db_examples.cpython-310.pyc differ
|
|
__pycache__/demo_utils1.cpython-310.pyc
CHANGED
Binary files a/__pycache__/demo_utils1.cpython-310.pyc and b/__pycache__/demo_utils1.cpython-310.pyc differ
|
|
app.py
CHANGED
@@ -153,24 +153,24 @@ def clear_cache(output_path):
|
|
153 |
|
154 |
#! 加载模型
|
155 |
# 配置路径和加载模型
|
156 |
-
config_path = 'configs/instruct_v2v_ic_gradio.yaml'
|
157 |
-
diffusion_model = unit_test_create_model(config_path)
|
158 |
-
diffusion_model = diffusion_model.to('cuda')
|
159 |
|
160 |
-
# 加载模型检查点
|
161 |
-
# ckpt_path = 'models/relvid_mm_sd15_fbc_unet.pth' #! change
|
162 |
-
# ckpt_path = 'tmp/pytorch_model.bin'
|
163 |
-
# 下载文件
|
164 |
|
165 |
-
os.makedirs('models', exist_ok=True)
|
166 |
-
model_path = "models/relvid_mm_sd15_fbc_unet.pth"
|
167 |
|
168 |
-
if not os.path.exists(model_path):
|
169 |
-
|
170 |
|
171 |
|
172 |
-
ckpt = torch.load(model_path, map_location='cpu')
|
173 |
-
diffusion_model.load_state_dict(ckpt, strict=False)
|
174 |
|
175 |
|
176 |
# import pdb; pdb.set_trace()
|
@@ -367,14 +367,14 @@ quick_prompts = [[x] for x in quick_prompts]
|
|
367 |
# }
|
368 |
# """
|
369 |
|
370 |
-
css = """
|
371 |
-
|
372 |
-
|
373 |
-
}
|
374 |
-
"""
|
375 |
|
376 |
# Gradio UI 结构
|
377 |
-
block = gr.Blocks(
|
378 |
with block:
|
379 |
with gr.Row():
|
380 |
# gr.Markdown("## RelightVid (Relighting with Foreground and Background Video Condition)")
|
@@ -416,17 +416,16 @@ with block:
|
|
416 |
# normal_button = gr.Button(value="Compute Normal (4x Slower)")
|
417 |
|
418 |
with gr.Column():
|
419 |
-
result_video = gr.Video(label='Output Video', height=750,
|
420 |
|
421 |
-
prompt = gr.Textbox(label="Prompt"
|
422 |
bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
423 |
value=BGSource.UPLOAD.value,
|
424 |
label="Background Source",
|
425 |
-
type='value'
|
426 |
-
elem_id="bg-source")
|
427 |
|
428 |
-
example_prompts = gr.Dataset(samples=quick_prompts, label='Prompt Quick List', components=[prompt]
|
429 |
-
relight_button = gr.Button(value="Relight"
|
430 |
|
431 |
# prompt = gr.Textbox(label="Prompt")
|
432 |
# bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
|
|
153 |
|
154 |
#! 加载模型
|
155 |
# 配置路径和加载模型
|
156 |
+
# config_path = 'configs/instruct_v2v_ic_gradio.yaml'
|
157 |
+
# diffusion_model = unit_test_create_model(config_path)
|
158 |
+
# diffusion_model = diffusion_model.to('cuda')
|
159 |
|
160 |
+
# # 加载模型检查点
|
161 |
+
# # ckpt_path = 'models/relvid_mm_sd15_fbc_unet.pth' #! change
|
162 |
+
# # ckpt_path = 'tmp/pytorch_model.bin'
|
163 |
+
# # 下载文件
|
164 |
|
165 |
+
# os.makedirs('models', exist_ok=True)
|
166 |
+
# model_path = "models/relvid_mm_sd15_fbc_unet.pth"
|
167 |
|
168 |
+
# if not os.path.exists(model_path):
|
169 |
+
# download_url_to_file(url='https://huggingface.co/aleafy/RelightVid/resolve/main/relvid_mm_sd15_fbc_unet.pth', dst=model_path)
|
170 |
|
171 |
|
172 |
+
# ckpt = torch.load(model_path, map_location='cpu')
|
173 |
+
# diffusion_model.load_state_dict(ckpt, strict=False)
|
174 |
|
175 |
|
176 |
# import pdb; pdb.set_trace()
|
|
|
367 |
# }
|
368 |
# """
|
369 |
|
370 |
+
# css = """
|
371 |
+
# #prompt-box, #bg-source, #quick-list, #relight-btn {
|
372 |
+
# width: 750px !important;
|
373 |
+
# }
|
374 |
+
# """
|
375 |
|
376 |
# Gradio UI 结构
|
377 |
+
block = gr.Blocks().queue()
|
378 |
with block:
|
379 |
with gr.Row():
|
380 |
# gr.Markdown("## RelightVid (Relighting with Foreground and Background Video Condition)")
|
|
|
416 |
# normal_button = gr.Button(value="Compute Normal (4x Slower)")
|
417 |
|
418 |
with gr.Column():
|
419 |
+
result_video = gr.Video(label='Output Video', height=750, visible=True)
|
420 |
|
421 |
+
prompt = gr.Textbox(label="Prompt")
|
422 |
bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
423 |
value=BGSource.UPLOAD.value,
|
424 |
label="Background Source",
|
425 |
+
type='value')
|
|
|
426 |
|
427 |
+
example_prompts = gr.Dataset(samples=quick_prompts, label='Prompt Quick List', components=[prompt])
|
428 |
+
relight_button = gr.Button(value="Relight")
|
429 |
|
430 |
# prompt = gr.Textbox(label="Prompt")
|
431 |
# bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
app1_rg3.py
CHANGED
@@ -365,8 +365,15 @@ quick_prompts = [[x] for x in quick_prompts]
|
|
365 |
# }
|
366 |
# """
|
367 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
368 |
# Gradio UI 结构
|
369 |
-
block = gr.Blocks().queue()
|
370 |
with block:
|
371 |
with gr.Row():
|
372 |
# gr.Markdown("## RelightVid (Relighting with Foreground and Background Video Condition)")
|
@@ -408,15 +415,28 @@ with block:
|
|
408 |
# normal_button = gr.Button(value="Compute Normal (4x Slower)")
|
409 |
|
410 |
with gr.Column():
|
411 |
-
result_video = gr.Video(label='Output Video', height=
|
412 |
|
413 |
-
prompt = gr.Textbox(label="Prompt")
|
414 |
bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
415 |
value=BGSource.UPLOAD.value,
|
416 |
-
label="Background Source",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
417 |
|
418 |
-
example_prompts = gr.Dataset(samples=quick_prompts, label='Prompt Quick List', components=[prompt])
|
419 |
-
relight_button = gr.Button(value="Relight")
|
420 |
# fg_gallery = gr.Gallery(witdth=400, object_fit='contain', label='Foreground Quick List', value=db_examples.bg_samples, columns=4, allow_preview=False)
|
421 |
# fg_gallery = gr.Gallery(
|
422 |
# height=380,
|
|
|
365 |
# }
|
366 |
# """
|
367 |
|
368 |
+
css = """
|
369 |
+
#prompt-box, #bg-source, #quick-list, #relight-btn {
|
370 |
+
width: 750px !important;
|
371 |
+
|
372 |
+
}
|
373 |
+
"""
|
374 |
+
|
375 |
# Gradio UI 结构
|
376 |
+
block = gr.Blocks(css=css).queue()
|
377 |
with block:
|
378 |
with gr.Row():
|
379 |
# gr.Markdown("## RelightVid (Relighting with Foreground and Background Video Condition)")
|
|
|
415 |
# normal_button = gr.Button(value="Compute Normal (4x Slower)")
|
416 |
|
417 |
with gr.Column():
|
418 |
+
result_video = gr.Video(label='Output Video', height=750, width=750, visible=True)
|
419 |
|
420 |
+
prompt = gr.Textbox(label="Prompt", elem_id="prompt-box")
|
421 |
bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
422 |
value=BGSource.UPLOAD.value,
|
423 |
+
label="Background Source",
|
424 |
+
type='value',
|
425 |
+
elem_id="bg-source")
|
426 |
+
|
427 |
+
example_prompts = gr.Dataset(samples=quick_prompts, label='Prompt Quick List', components=[prompt], elem_id="quick-list")
|
428 |
+
relight_button = gr.Button(value="Relight", elem_id="relight-btn")
|
429 |
+
|
430 |
+
|
431 |
+
# prompt = gr.Textbox(label="Prompt")
|
432 |
+
# bg_source = gr.Radio(choices=[e.value for e in BGSource],
|
433 |
+
# value=BGSource.UPLOAD.value,
|
434 |
+
# label="Background Source", type='value')
|
435 |
+
|
436 |
+
# example_prompts = gr.Dataset(samples=quick_prompts, label='Prompt Quick List', components=[prompt])
|
437 |
+
# relight_button = gr.Button(value="Relight")
|
438 |
+
|
439 |
|
|
|
|
|
440 |
# fg_gallery = gr.Gallery(witdth=400, object_fit='contain', label='Foreground Quick List', value=db_examples.bg_samples, columns=4, allow_preview=False)
|
441 |
# fg_gallery = gr.Gallery(
|
442 |
# height=380,
|
misc_utils/__pycache__/flow_utils.cpython-310.pyc
CHANGED
Binary files a/misc_utils/__pycache__/flow_utils.cpython-310.pyc and b/misc_utils/__pycache__/flow_utils.cpython-310.pyc differ
|
|
misc_utils/__pycache__/image_utils.cpython-310.pyc
CHANGED
Binary files a/misc_utils/__pycache__/image_utils.cpython-310.pyc and b/misc_utils/__pycache__/image_utils.cpython-310.pyc differ
|
|
misc_utils/__pycache__/model_utils.cpython-310.pyc
CHANGED
Binary files a/misc_utils/__pycache__/model_utils.cpython-310.pyc and b/misc_utils/__pycache__/model_utils.cpython-310.pyc differ
|
|
misc_utils/__pycache__/train_utils.cpython-310.pyc
CHANGED
Binary files a/misc_utils/__pycache__/train_utils.cpython-310.pyc and b/misc_utils/__pycache__/train_utils.cpython-310.pyc differ
|
|
modules/openclip/__pycache__/modules.cpython-310.pyc
CHANGED
Binary files a/modules/openclip/__pycache__/modules.cpython-310.pyc and b/modules/openclip/__pycache__/modules.cpython-310.pyc differ
|
|
modules/video_unet_temporal/__pycache__/attention.cpython-310.pyc
CHANGED
Binary files a/modules/video_unet_temporal/__pycache__/attention.cpython-310.pyc and b/modules/video_unet_temporal/__pycache__/attention.cpython-310.pyc differ
|
|
modules/video_unet_temporal/__pycache__/motion_module.cpython-310.pyc
CHANGED
Binary files a/modules/video_unet_temporal/__pycache__/motion_module.cpython-310.pyc and b/modules/video_unet_temporal/__pycache__/motion_module.cpython-310.pyc differ
|
|
modules/video_unet_temporal/__pycache__/resnet.cpython-310.pyc
CHANGED
Binary files a/modules/video_unet_temporal/__pycache__/resnet.cpython-310.pyc and b/modules/video_unet_temporal/__pycache__/resnet.cpython-310.pyc differ
|
|
modules/video_unet_temporal/__pycache__/unet.cpython-310.pyc
CHANGED
Binary files a/modules/video_unet_temporal/__pycache__/unet.cpython-310.pyc and b/modules/video_unet_temporal/__pycache__/unet.cpython-310.pyc differ
|
|
modules/video_unet_temporal/__pycache__/unet_blocks.cpython-310.pyc
CHANGED
Binary files a/modules/video_unet_temporal/__pycache__/unet_blocks.cpython-310.pyc and b/modules/video_unet_temporal/__pycache__/unet_blocks.cpython-310.pyc differ
|
|
pl_trainer/__pycache__/diffusion.cpython-310.pyc
CHANGED
Binary files a/pl_trainer/__pycache__/diffusion.cpython-310.pyc and b/pl_trainer/__pycache__/diffusion.cpython-310.pyc differ
|
|
pl_trainer/__pycache__/instruct_p2p_video.cpython-310.pyc
CHANGED
Binary files a/pl_trainer/__pycache__/instruct_p2p_video.cpython-310.pyc and b/pl_trainer/__pycache__/instruct_p2p_video.cpython-310.pyc differ
|
|
pl_trainer/inference/__pycache__/inference.cpython-310.pyc
CHANGED
Binary files a/pl_trainer/inference/__pycache__/inference.cpython-310.pyc and b/pl_trainer/inference/__pycache__/inference.cpython-310.pyc differ
|
|