Instructions to use aidealab/AnimeGen-I2V with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use aidealab/AnimeGen-I2V with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image, export_to_video # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("aidealab/AnimeGen-I2V", torch_dtype=torch.bfloat16, device_map="cuda") pipe.to("cuda") prompt = "A man with short gray hair plays a red electric guitar." image = load_image( "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/guitar-man.png" ) output = pipe(image=image, prompt=prompt).frames[0] export_to_video(output, "output.mp4") - Notebooks
- Google Colab
- Kaggle
Unable to generate
Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.
Flax classes are deprecated and will be removed in Diffusers v1.0.0. We recommend migrating to PyTorch classes or pinning your version of Diffusers.
HTTPStatusError Traceback (most recent call last)
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_http.py in hf_raise_for_status(response, endpoint_name)
760 try:
--> 761 response.raise_for_status()
762 except httpx.HTTPStatusError as e:
/usr/local/lib/python3.12/dist-packages/httpx/_models.py in raise_for_status(self)
828 message = message.format(self, error_type=error_type)
--> 829 raise HTTPStatusError(message, request=request, response=self)
830
HTTPStatusError: Client error '404 Not Found' for url 'https://huggingface.co/aidealab/AnimeGen-I2V/resolve/main/model_index.json'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
The above exception was the direct cause of the following exception:
RemoteEntryNotFoundError Traceback (most recent call last)
/tmp/ipykernel_58/3189906611.py in <cell line: 0>()
4
5 # switch to "mps" for apple devices
----> 6 pipe = DiffusionPipeline.from_pretrained("aidealab/AnimeGen-I2V", dtype=torch.bfloat16, device_map="cuda")
7 pipe.to("cuda")
8
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
86 kwargs = smoothly_deprecate_legacy_arguments(fn_name=fn.name, kwargs=kwargs)
87
---> 88 return fn(*args, **kwargs)
89
90 return _inner_fn # type: ignore
/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
851 " is neither a valid local path nor a valid repo id. Please check the parameter."
852 )
--> 853 cached_folder = cls.download(
854 pretrained_model_name_or_path,
855 cache_dir=cache_dir,
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
86 kwargs = smoothly_deprecate_legacy_arguments(fn_name=fn.name, kwargs=kwargs)
87
---> 88 return fn(*args, **kwargs)
89
90 return _inner_fn # type: ignore
/usr/local/lib/python3.12/dist-packages/diffusers/pipelines/pipeline_utils.py in download(cls, pretrained_model_name, **kwargs)
1634
1635 if not local_files_only:
-> 1636 config_file = hf_hub_download(
1637 pretrained_model_name,
1638 cls.config_name,
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
86 kwargs = smoothly_deprecate_legacy_arguments(fn_name=fn.name, kwargs=kwargs)
87
---> 88 return fn(*args, **kwargs)
89
90 return _inner_fn # type: ignore
/usr/local/lib/python3.12/dist-packages/huggingface_hub/file_download.py in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, user_agent, force_download, etag_timeout, token, local_files_only, headers, endpoint, tqdm_class, dry_run)
995 )
996 else:
--> 997 return _hf_hub_download_to_cache_dir(
998 # Destination
999 cache_dir=cache_dir,
/usr/local/lib/python3.12/dist-packages/huggingface_hub/file_download.py in _hf_hub_download_to_cache_dir(cache_dir, repo_id, filename, repo_type, revision, endpoint, etag_timeout, headers, token, local_files_only, force_download, tqdm_class, dry_run)
1070 # Try to get metadata (etag, commit_hash, url, size) from the server.
1071 # If we can't, a HEAD request error is returned.
-> 1072 (url_to_download, etag, commit_hash, expected_size, xet_file_data, head_call_error) = _get_metadata_or_catch_error(
1073 repo_id=repo_id,
1074 filename=filename,
/usr/local/lib/python3.12/dist-packages/huggingface_hub/file_download.py in _get_metadata_or_catch_error(repo_id, filename, repo_type, revision, endpoint, etag_timeout, headers, token, local_files_only, relative_filename, storage_folder, retry_on_errors)
1667 try:
1668 try:
-> 1669 metadata = get_hf_file_metadata(
1670 url=url,
1671 timeout=etag_timeout,
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, **kwargs)
86 kwargs = smoothly_deprecate_legacy_arguments(fn_name=fn.name, kwargs=kwargs)
87
---> 88 return fn(*args, **kwargs)
89
90 return _inner_fn # type: ignore
/usr/local/lib/python3.12/dist-packages/huggingface_hub/file_download.py in get_hf_file_metadata(url, token, timeout, library_name, library_version, user_agent, headers, endpoint, retry_on_errors)
1589
1590 # Retrieve metadata
-> 1591 response = _httpx_follow_relative_redirects_with_backoff(
1592 method="HEAD", url=url, headers=hf_headers, timeout=timeout, retry_on_errors=retry_on_errors
1593 )
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_http.py in _httpx_follow_relative_redirects_with_backoff(method, url, retry_on_errors, **httpx_kwargs)
690 **no_retry_kwargs,
691 )
--> 692 hf_raise_for_status(response)
693
694 # Check if response is a relative redirect
/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_http.py in hf_raise_for_status(response, endpoint_name)
779 elif error_code == "EntryNotFound":
780 message = f"{response.status_code} Client Error." + "\n\n" + f"Entry Not Found for url: {response.url}."
--> 781 raise _format(RemoteEntryNotFoundError, message, response, repo_type=repo_type, repo_id=repo_id) from e
782
783 elif error_code == "GatedRepo":
RemoteEntryNotFoundError: 404 Client Error. (Request ID: Root=1-6a5d93dc-3576fb14542242b15c45a6af;eab34245-50eb-4fce-b3bd-e884b00ecf96)
Entry Not Found for url: https://huggingface.co/aidealab/AnimeGen-I2V/resolve/main/model_index.jso