{"id":34017965,"url":"https://github.com/lucidrains/maskbit-pytorch","last_synced_at":"2025-12-13T14:52:50.569Z","repository":{"id":257943398,"uuid":"868959933","full_name":"lucidrains/maskbit-pytorch","owner":"lucidrains","description":"Implementation of the proposed MaskBit from Bytedance AI","archived":false,"fork":false,"pushed_at":"2024-11-12T19:17:56.000Z","size":302,"stargazers_count":82,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-27T06:47:14.422Z","etag":null,"topics":["artificial-intelligence","autoencoder","binary-quantization","deep-learning","image-generation","scalar-quantization","transformers","vqgan-vae"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucidrains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-07T13:34:16.000Z","updated_at":"2025-08-25T18:16:02.000Z","dependencies_parsed_at":"2024-10-22T00:48:46.373Z","dependency_job_id":null,"html_url":"https://github.com/lucidrains/maskbit-pytorch","commit_stats":null,"previous_names":["lucidrains/maskbit-pytorch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucidrains/maskbit-pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmaskbit-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmaskbit-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmaskbit-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmaskbit-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucidrains","download_url":"https://codeload.github.com/lucidrains/maskbit-pytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucidrains%2Fmaskbit-pytorch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27707514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-13T02:00:09.769Z","response_time":147,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","autoencoder","binary-quantization","deep-learning","image-generation","scalar-quantization","transformers","vqgan-vae"],"created_at":"2025-12-13T14:52:50.047Z","updated_at":"2025-12-13T14:52:50.560Z","avatar_url":"https://github.com/lucidrains.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./maskbit.png\" width=\"400px\"\u003e\u003c/img\u003e\n\n## MaskBit - Pytorch (wip)\n\nImplementation of the proposed [MaskBit](https://arxiv.org/abs/2409.16211) from Bytedance AI\n\nThis paper can be viewed as a modernized version of the architecture from [Taming Transformers](https://arxiv.org/abs/2012.09841) from Esser et al.\n\nThey use the binary scalar quantization proposed in [MagVit2](https://arxiv.org/abs/2310.05737) in their autoencoder, and then non-autoregressive mask decoding, where the masking is setting the bit (`-1` or `+1`) to `0`, projected for the transformer without explicit embeddings for the trit\n\n## Usage\n\n```python\nimport torch\nfrom maskbit_pytorch import BQVAE, MaskBit\n\nimages = torch.randn(1, 3, 64, 64)\n\n# train vae\n\nvae = BQVAE(\n    image_size = 64,\n    dim = 512\n)\n\nloss = vae(images, return_loss = True)\nloss.backward()\n\n# train maskbit\n\nmaskbit = MaskBit(\n    vae,\n    dim = 512,\n    bits_group_size = 512,\n    depth = 2\n)\n\nloss = maskbit(images)\nloss.backward()\n\n# after much training\n\nsampled_image = maskbit.sample() # (1, 3, 64, 64)\n```\n\n## Citations\n\n```bibtex\n@inproceedings{Weber2024MaskBitEI,\n    title   = {MaskBit: Embedding-free Image Generation via Bit Tokens},\n    author  = {Mark Weber and Lijun Yu and Qihang Yu and Xueqing Deng and Xiaohui Shen and Daniel Cremers and Liang-Chieh Chen},\n    year    = {2024},\n    url     = {https://api.semanticscholar.org/CorpusID:272832013}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fmaskbit-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucidrains%2Fmaskbit-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucidrains%2Fmaskbit-pytorch/lists"}