{"id":29571021,"url":"https://github.com/compvis/scflow","last_synced_at":"2026-02-05T12:34:21.944Z","repository":{"id":301605548,"uuid":"1009789889","full_name":"CompVis/SCFlow","owner":"CompVis","description":"[ICCV 2025] SCFlow: Implicitly Learning Style and Content Disentanglement with Flow Models","archived":false,"fork":false,"pushed_at":"2025-08-12T15:03:31.000Z","size":38416,"stargazers_count":23,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T05:24:25.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/CompVis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-27T18:02:51.000Z","updated_at":"2025-09-09T15:22:25.000Z","dependencies_parsed_at":"2025-09-10T04:11:10.667Z","dependency_job_id":null,"html_url":"https://github.com/CompVis/SCFlow","commit_stats":null,"previous_names":["compvis/scflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CompVis/SCFlow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2FSCFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2FSCFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2FSCFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2FSCFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CompVis","download_url":"https://codeload.github.com/CompVis/SCFlow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CompVis%2FSCFlow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29121788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T10:47:47.471Z","status":"ssl_error","status_checked_at":"2026-02-05T10:45:08.119Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-07-19T03:07:56.692Z","updated_at":"2026-02-05T12:34:21.935Z","avatar_url":"https://github.com/CompVis.png","language":"Jupyter Notebook","readme":"\u003cp align=\"center\"\u003e\n \u003ch2 align=\"center\"\u003eSCFlow: Implicitly Learning Style and Content Disentanglement with Flow Models\u003c/h2\u003e\n \u003cp align=\"center\"\u003e \n    Pingchuan Ma\u003csup\u003e*\u003c/sup\u003e · Xiaopei Yang\u003csup\u003e*\u003c/sup\u003e · Yusong Li\n \u003c/p\u003e\u003cp align=\"center\"\u003e \n    Ming Gui · Felix Krause · Johannes Schusterbauer · Björn Ommer\n \u003c/p\u003e\n \u003cp align=\"center\"\u003e \n   \u003cb\u003eCompVis Group @ LMU Munich\u003c/b\u003e \u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cb\u003eMunich Center for Machine Learning (MCML)\u003c/b\u003e \n \u003c/p\u003e\n \u003cp align=\"center\"\u003e \n    \n \u003c/p\u003e\n \u003cp align=\"center\"\u003e \u003csup\u003e*\u003c/sup\u003e \u003ci\u003eequal contribution\u003c/i\u003e \u003c/p\u003e\n \n\u003cp align=\"center\"\u003e\u003cstrong\u003e📄 ICCV 2025\u003c/strong\u003e\u003c/p\u003e\n  \n\u003c/p\u003e\n\n\n\u003ca href=\"https://compvis.github.io/SCFlow/\"\u003e\u003cimg src=\"docs/static/figures/badge-website.svg\" alt=\"Website\"\u003e\u003c/a\u003e\n\u003ca href=\"https://arxiv.org/abs/2508.03402\"\u003e\u003cimg src=\"https://img.shields.io/badge/arXiv-PDF-b31b1b\" alt=\"Paper\"\u003e\u003c/a\u003e\n\u003ca href=\"https://huggingface.co/CompVis/SCFlow\"\u003e\u003cimg src=\"https://img.shields.io/badge/HuggingFace-Weights-orange\" alt=\"Paper\"\u003e\u003c/a\u003e\n\nThis repository contains the official implementation of the paper \"SCFlow: Implicitly Learning Style and Content Disentanglement with Flow Models\".\nWe proposed a flow-matching framework that learns an invertible mapping between style-content mixtures and their separate representations, avoiding explicit disentanglement objectives. Together with the method, we have curated a 510k synthetic dataset consisting of 10k content instances and 51 distinct styles.\n\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"docs/static/images/teaser.jpg\" alt=\"Cover\" width=\"80%\"\u003e\n\u003c/p\u003e\n\n\n\n## 🛠️ Setup\nCreate the enviroment with conda:\n```bash\nconda create -n scflow python=3.10\nconda activate scflow\npip install -r requirements.txt\n```\nThe enviroment was tested on `Ubuntu 22.04.5 LTS` with `CUDA 12.1`. You can *optionally* install jupyter-notebook to run the notebook provided in [`notebooks`](https://github.com/CompVis/SCFlow/tree/main/notebooks)\n\nDownload the model checkpoints:\n```bash\nmkdir ckpts\ncd ckpts\n\n# model checkpoint\nwget https://huggingface.co/CompVis/SCFlow/resolve/main/scflow_last.ckpt\n\n# unclip checkpoint for visualization\nwget https://huggingface.co/CompVis/SCFlow/resolve/main/sd21-unclip-l.ckpt\n```\n\nDownload the training and test splits of the dataset:\n```bash\n# return to parent dir\ncd ..\nmkdir dataset\ncd dataset\n\n# training split with meta data, e.g., content and style idx and content description etc.\nwget https://huggingface.co/CompVis/SCFlow/resolve/main/train.h5\n\n\n# test split with meta data, e.g., content and style idx and content description etc.\nwget https://huggingface.co/CompVis/SCFlow/resolve/main/test.h5\n\n```\n\n\n## 🔥 Usage\nThe following bash scripts are just naive wrappers for an easy start. You can the args accordingly by calling directly the `training.py` and `inference.py`.\n\nInference forward (merge content and style)\n```bash\nbash scripts/inference_forward.sh\n```\nInference reverse (disentangle content and style from a given reference)\n```bash\nbash scripts/inference_reverse.sh\n```\n\nFor training you would need ~22GB with the default setting.\n```bash\nbash scripts/training.sh\n```\n\n## 🗂️ Dataset Overview\nWe hosted the dataset (currently only the clip embeddings and their corresponding metadata due to the space limit) on HF. You can download them as instructed in the above section. The file `train.h5` (same holds for `test.h5`) is an HDF5 dataset storing embeddings and metadata useful for training. You can load it in Python with:\n\n```python\nimport h5py\ntrain = h5py.File(”./dataset/train.h5”, ‘r’)\n```\n\nThe main groups inside are:\n\n- **images**: Contains CLIP embeddings with shape `(357000, 768)`, representing feature vectors for training samples.\n- **metadata**: Contains descriptive information with keys:\n  - `content_description`\n  - `content_idx`\n  - `style_idx`\n  - `style_name`\n\n\u003e **Note:** Some metadata entries can be duplicated because there are 7000 content variations for training and 3000 for testing. This means the same content with different styles will have identical `content_description` and `content_idx`.\n\n### Original Images in 512px\nWe hosted the original images on HF. You should be able to download them by calling:\n```bash\n\n# The zip file is around 36.5 GB. \nwget https://huggingface.co/CompVis/SCFlow/resolve/main/raw_512px.zip\n\n```\nIt is structured by styles, then different content ids, e.g., `Cubism/00001.jpg ... 10000.jpg`, where the content ids are consistent across different styles.\n\n## 🎓 Citation \u0026 Contact\n\nIf you use this codebase and dataset, or found our work valuable, please cite our paper:\n```bibtex\n@inproceedings{ma2025scflow,\n    author    = {Ma, Pingchuan and Yang, Xiaopei and Li, Yusong and Gui, Ming and Krause, Felix and Schusterbauer, Johannes and Ommer, Bj\\\"orn},\n    title     = {SCFlow: Implicitly Learning Style and Content Disentanglement with Flow Models},\n    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},\n    month     = {October},\n    year      = {2025},\n    pages     = {14919-14929}\n}\n```\n\nIn case you encounter any issues or would like to collaborate, plz feel free to drop me a message:\n* Email: p.ma(at)lmu(dot)de\n* [linkedin](https://www.linkedin.com/in/pingchuan-ma-492543156/)\n\n## 🔥 Updates and Backlogs\n- [x] **[06.08.2025]** [ArXiv](https://arxiv.org/abs/2508.03402) paper avaiable.\n- [x] **[12.08.2025]** Release Inference code and ckpt.\n- [x] **[31.10.2025]** Host the dataset (latent and metadata) and training code.\n- [x] **[31.10.2025]** Uploaded the 512px jpg images in HF.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompvis%2Fscflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompvis%2Fscflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompvis%2Fscflow/lists"}