Stability-AI / stability-sdk

SDK for interacting with stability.ai APIs (e.g. stable diffusion inference)
https://platform.stability.ai/
MIT License
2.41k stars 339 forks source link

ModuleNotFoundError: No module named 'keyframed' #264

Closed dcsan closed 8 months ago

dcsan commented 8 months ago

I'm trying to install the anima sdk and get an error.

from keyframed.dsl import curve_from_cn_string
ModuleNotFoundError: No module named 'keyframed'

from this >> https://github.com/Stability-AI/stability-sdk/blob/main/src/stability_sdk/animation.py#L16C6-L16C15

previously I was using the anima_stable branch, but that also errors out now.

I was installing from source here:

git clone -b anima_stable --recurse-submodules https://github.com/Stability-AI/stability-sdk
pip install ./stability-sdk

but I guess this also now works?

pip install stability-sdk[anim_ui]

perhaps you could add keyframed as a dependency.

pip install keyframed
pip install pretty-simple-namespace

fixed

dcsan commented 8 months ago

stacktrace is in the animate loop

Traceback (most recent call last):
  File "/Users/dc/dev/revel/ai-anims-v2/animai/stabai/animator.py", line 151, in animate
    for frame_idx, frame in enumerate(tqdm(
  File "/Users/dc/dev/revel/ai-anims-v2/venv/lib/python3.10/site-packages/tqdm/std.py", line 1195, in __iter__
    for obj in iterable:
  File "/Users/dc/dev/revel/ai-anims-v2/venv/lib/python3.10/site-packages/stability_sdk/animation.py", line 640, in render
    self.inpaint_mask = self.transform_video(frame_idx)
  File "/Users/dc/dev/revel/ai-anims-v2/venv/lib/python3.10/site-packages/stability_sdk/animation.py", line 949, in transform_video
    video_next_frame = cv2_to_pil(video_next_frame)
  File "/Users/dc/dev/revel/ai-anims-v2/venv/lib/python3.10/site-packages/stability_sdk/animation.py", line 219, in cv2_to_pil
    return Image.fromarray(cv2_img[:, :, ::-1])
TypeError: 'NoneType' object is not subscriptable

#### ERROR [render] some other exception ####
TypeError("'NoneType' object is not subscriptable")
pharmapsychotic commented 8 months ago

Yes, that's correct for the animation features the package must be installed with stability-sdk[anim] or stability-sdk[anim_ui]

https://github.com/Stability-AI/stability-sdk#animation-ui https://platform.stability.ai/docs/features/animation/install

dcsan commented 8 months ago

just noting for others that quotes are needed (at least on a mac)

pip install "stability-sdk[anim]"