{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence/7"}],"enrichment":{"capability":"Speeds up Stable Diffusion image generation by merging redundant tokens in the transformer, reducing computation and memory without requiring model retraining.","skillfed_tags":["diffusion-models","inference-optimization","transformer-acceleration"],"use_cases":["Generate images faster on consumer GPUs by trading minor quality loss for 1.5\u20132x speedup and reduced VRAM pressure.","Reduce memory footprint when running Stable Diffusion on hardware with limited VRAM, enabling larger batch sizes or higher resolutions.","Combine with other efficiency techniques to stack speedups without reimplementing transformer modules.","Patch existing Stable Diffusion workflows with a single function call and no model changes.","Experiment with token merging ratios to find the sweet spot between speed and quality for your specific use case."],"what_it_does":"ToMe for SD is a pure-Python patch that accelerates Stable Diffusion by identifying and merging redundant tokens during the diffusion process. It works by reducing the number of tokens the transformer must process, cutting both computation time and memory usage without requiring any model retraining. The patch applies directly to existing Stable Diffusion implementations and downstream UIs that use them.\n\nThe trade-off is intentional and controlled: merging tokens is lossy, so generated images will differ slightly from the unpatched baseline. The paper reports that at a 50% merge ratio, generation is 1.35x faster and uses 1.57x less memory with minimal quality loss. More aggressive merging (60%) achieves 2x speedup and 5.7x memory reduction, though quality degradation increases. You control this trade-off via the `ratio` parameter when calling `apply_patch()`.","worth_installing":"Yes, if you run Stable Diffusion and want faster inference with controllable quality trade-offs. Installation is trivial, the patch is non-invasive (reversible via `remove_patch`), and it works out-of-the-box on standard Stable Diffusion setups. The main caveat is dormant maintenance\u2014no active development since mid-2023\u2014so compatibility with very recent model releases is unverified. For established workflows, it's a low-risk, high-value optimization."},"id":"tomesd","links":{"html":"https://skillfed.io/packages/tomesd","md":"https://skillfed.io/packages/tomesd.md","pypi":"https://pypi.org/project/tomesd/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2023-05-14","license_spdx":null,"license_treatment":"permissive","name":"tomesd","python_support":"unspecified","summary":"Token Merging for Stable Diffusion"},"popularity":{"monthly_downloads":223975,"position":9237,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.1.3"}
