Open darkcurrent opened 1 year ago
overlap: Number of frames to overlap in context (default: context//4)
PS: When an error occurs, you can also print the correct command-line interface (CLI) parameters for troubleshooting purposes.
Thank you,
I have manage to run generate
and tile_upscale
functions. But I have two more questions for you guys...
Can we use the rife interpolate
command from separate python interpreter as well?
When the stride argument from the generate function is setted other than "0" i gave some errors in the separate python interpreter mode.
Using library on external python interpreter setting stride to 1 or more than 1 it gives this error:
Traceback (most recent call last):
File "/home/cagin/story-bot/storybot/worker-services/worker_animatediff.py", line 203, in <module>
out_dir_gen = generate(
File "/home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/cli.py", line 406, in generate
output = run_inference(
File "/home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/generate.py", line 1182, in run_inference
pipeline_output = pipeline(
File "/home/cagin/miniconda3/envs/test/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/pipelines/animation.py", line 2896, in __call__
down_block_res_samples,mid_block_res_sample = get_controlnet_result(context)
File "/home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/pipelines/animation.py", line 2700, in get_controlnet_result
first_down = list(list(controlnet_result.values())[0].values())[0][0]
IndexError: list index out of range
Using directly the terminal it won't give any errors when -S argument is setted to "1".
animatediff generate -c config/prompts/prompt_travel_test.json -W 256 -H 384 -L 64 -C 16 -S 1
Again trying with -S is setted to 2 it gives this error
animatediff generate -c config/prompts/prompt_travel_test.json -W 256 -H 384 -L 64 -C 16 -S 2
Error:
19:41:11 INFO No TI embeddings found ti.py:102
INFO loading c='controlnet_openpose' model generate.py:482
INFO loading c='controlnet_softedge' model generate.py:482
INFO Sending pipeline to device "cuda" pipeline.py:22
INFO Selected data types: unet_dtype=torch.float16, tenc_dtype=torch.float16, vae_dtype=torch.bfloat16 device.py:90
INFO Using channels_last memory format for UNet and VAE device.py:111
Preprocessing images (ip_adapter) 0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/2 [ 0:00:00 < -:--:-- , ? it/s ]
Saving Preprocessed images (ip_adapter) 0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/4 [ 0:00:00 < -:--:-- , ? it/s ]
19:41:12 INFO Saving prompt config to output directory cli.py:378
INFO Initialization complete! cli.py:386
INFO Generating 1 animations cli.py:387
INFO Running generation 1 of 1 cli.py:397
INFO Generation seed: 341774366206100 cli.py:403
INFO len( region_condi_list )=1 generate.py:1179
INFO len( region_list )=1 generate.py:1180
INFO multi_uncond_mode=False animation.py:2386
19% ━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42/220 [ 0:00:15 < 0:01:05 , 3 it/s ]
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/cli.py:406 in generate │
│ │
│ 403 │ │ │ logger.info(f"Generation seed: {seed}") │
│ 404 │ │ │ │
│ 405 │ │ │ │
│ ❱ 406 │ │ │ output = run_inference( │
│ 407 │ │ │ │ pipeline=g_pipeline, │
│ 408 │ │ │ │ n_prompt=n_prompt, │
│ 409 │ │ │ │ seed=seed, │
│ │
│ /home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/generate.py:1182 in │
│ run_inference │
│ │
│ 1179 │ logger.info(f"{len( region_condi_list )=}") │
│ 1180 │ logger.info(f"{len( region_list )=}") │
│ 1181 │ │
│ ❱ 1182 │ pipeline_output = pipeline( │
│ 1183 │ │ negative_prompt=n_prompt, │
│ 1184 │ │ num_inference_steps=steps, │
│ 1185 │ │ guidance_scale=guidance_scale, │
│ │
│ /home/cagin/miniconda3/envs/test/lib/python3.10/site-packages/torch/utils/_contextlib.py:115 in │
│ decorate_context │
│ │
│ 112 │ @functools.wraps(func) │
│ 113 │ def decorate_context(*args, **kwargs): │
│ 114 │ │ with ctx_factory(): │
│ ❱ 115 │ │ │ return func(*args, **kwargs) │
│ 116 │ │
│ 117 │ return decorate_context │
│ 118 │
│ │
│ /home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/pipelines/animation.py:2896 in │
│ __call__ │
│ │
│ 2893 │ │ │ │ │ │
│ 2894 │ │ │ │ │ cur_prompt = prompt_encoder.get_current_prompt_embeds(context, laten │
│ 2895 │ │ │ │ │ │
│ ❱ 2896 │ │ │ │ │ down_block_res_samples,mid_block_res_sample = get_controlnet_result( │
│ 2897 │ │ │ │ │ │
│ 2898 │ │ │ │ │ if c_ref_enable: │
│ 2899 │ │ │ │ │ │ # ref only part │
│ │
│ /home/cagin/.cache/animatediff-cli-prompt-travel/src/animatediff/pipelines/animation.py:2700 in │
│ get_controlnet_result │
│ │
│ 2697 │ │ │ │ │ │
│ 2698 │ │ │ │ │ _down_block_res_samples=[] │
│ 2699 │ │ │ │ │ │
│ ❱ 2700 │ │ │ │ │ first_down = list(list(controlnet_result.values())[0].values())[0][0 │
│ 2701 │ │ │ │ │ first_mid = list(list(controlnet_result.values())[0].values())[0][1] │
│ 2702 │ │ │ │ │ for ii in range(len(first_down)): │
│ 2703 │ │ │ │ │ │ _down_block_res_samples.append( │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range
it looks like the same error but it occurs only when -S is setted to 2 while separate python interpreter option gives this error when the stride argument is setted even 1...
Hi @s9roll7 , I am trying to use your library in my python script in the following way. In this way, the
controlnet_openpose
andcontrolnet_softedge
folders appear as expected in the00_detectmap
folder as specified in the config file. So the first stage is working. But the code goes to the next step I get the following error. If you can prepare a small example of using your library in a python project as a package I would appreciate it.I would like to be able to run commands like
generate
,tile_upscale
,refine
that we use via CLI in a python environment. I'm sure I'm making a simple mistake, I'd appreciate if you can help me.