Instructions to use Efficient-Large-Model/Sol-H3-VAE with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Efficient-Large-Model/Sol-H3-VAE with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Efficient-Large-Model/Sol-H3-VAE", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Download code/spark_fa4.py from Efficient-Large-Model/Sol-H3-VAE: direct link, hf CLI and curl.
- Browser
- Download file 999 Bytes
-
https://huggingface.co/Efficient-Large-Model/Sol-H3-VAE/resolve/main/code/spark_fa4.py
- Command line
-
hf download hf://Efficient-Large-Model/Sol-H3-VAE/code/spark_fa4.py
-
curl -L -o spark_fa4.py https://huggingface.co/Efficient-Large-Model/Sol-H3-VAE/resolve/main/code/spark_fa4.py
999 Bytes
| """Process-local SM120 fix for FlashAttention-4 (4.0.0b19-b22) varlen forward. | |
| On SM120 (RTX 5090, DGX Spark) surplus scheduler work tiles could read sequence | |
| metadata past the batch. _spark_flash_fwd_guarded.py is FA4's flash_fwd.py with that | |
| guard added; the installed FA4 package and valid-tile computation stay unchanged. | |
| """ | |
| from flash_attn.cute import interface | |
| from flash_attn.cute.cache_utils import JITCache | |
| from flash_attn.cute.flash_fwd_sm120 import FlashAttentionForwardSm120 | |
| from _spark_flash_fwd_guarded import FlashAttentionForwardSm80 | |
| class SparkFlashAttentionForwardSm120(FlashAttentionForwardSm120): | |
| kernel = FlashAttentionForwardSm80.kernel | |
| def enable_sm120_guard(): | |
| if interface.FlashAttentionForwardSm120 is SparkFlashAttentionForwardSm120: | |
| return | |
| interface.FlashAttentionForwardSm120 = SparkFlashAttentionForwardSm120 | |
| # Never reuse an unguarded binary from an existing in-memory/disk cache. | |
| interface._flash_attn_fwd.compile_cache = JITCache() | |