{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/oftsr-one-step-flow-for-image-super","title":"OFTSR: One-Step Flow for Image Super-Resolution with Tunable Fidelity-Realism Trade-offs","arxiv_id":"2412.09465","date":"2024-12-12","proceeding":null,"authors":["Yuanzhi Zhu","Ruiqing Wang","Shilin Lu","Junnan Li","Hanshu Yan","Kai Zhang"],"abstract":"Recent advances in diffusion and flow-based generative models have demonstrated remarkable success in image restoration tasks, achieving superior perceptual quality compared to traditional deep learning approaches. However, these methods either require numerous sampling steps to generate high-quality images, resulting in significant computational overhead, or rely on model distillation, which usually imposes a fixed fidelity-realism trade-off and thus lacks flexibility. In this paper, we introduce OFTSR, a novel flow-based framework for one-step image super-resolution that can produce outputs with tunable levels of fidelity and realism. Our approach first trains a conditional flow-based super-resolution model to serve as a teacher model. We then distill this teacher model by applying a specialized constraint. Specifically, we force the predictions from our one-step student model for same input to lie on the same sampling ODE trajectory of the teacher model. This alignment ensures that the student model's single-step predictions from initial states match the teacher's predictions from a closer intermediate state. Through extensive experiments on challenging datasets including FFHQ (256$\\times$256), DIV2K, and ImageNet (256$\\times$256), we demonstrate that OFTSR achieves state-of-the-art performance for one-step image super-resolution, while having the ability to flexibly tune the fidelity-realism trade-off. Code and pre-trained models are available at https://github.com/yuanzhi-zhu/OFTSR and https://huggingface.co/Yuanzhi/OFTSR, respectively.","url_abs":"https://arxiv.org/abs/2412.09465v1","url_pdf":"https://arxiv.org/pdf/2412.09465v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"oftsr-one-step-flow-for-image-super","repo_url":"https://github.com/yuanzhi-zhu/oftsr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-restoration","task_name":"Image Restoration"},{"task_slug":"image-super-resolution","task_name":"Image Super-Resolution"},{"task_slug":"super-resolution","task_name":"Super-Resolution"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2412.09465","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.09465"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/yuanzhizhu/OFTSR","reach":{"status":"gone","observed_at":"2026-09-17","how":"tree_404+repo_404"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yuanzhi-zhu/oftsr","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":3,"ran":1,"unverified":12},"by_repo_kind":{"official":{"samples":16,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"543fa13af92ef55b","entry":"calc_psnr","repo":"yuanzhi-zhu/OFTSR","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/yuanzhi-zhu/OFTSR/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"543fa13af92ef55b"}},{"code_sha256_prefix":"6d32f9cf6f29b386","entry":"constant","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/augment.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6d32f9cf6f29b386"}},{"code_sha256_prefix":"cdaadfbb9242c2cf","entry":"prepare_paired_batch","repo":"yuanzhi-zhu/OFTSR","repo_kind":"official","path":"train_fm.py","file_url":"https://github.com/yuanzhi-zhu/OFTSR/blob/HEAD/train_fm.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cdaadfbb9242c2cf"}},{"code_sha256_prefix":"129b804760b3115f","entry":"zero_module","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"models/nn.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/models/nn.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"129b804760b3115f"}},{"code_sha256_prefix":"ecd0fc28815b65ae","entry":"avg_pool_nd","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"models/nn.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/models/nn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ecd0fc28815b65ae"}},{"code_sha256_prefix":"fe4eb545bbb728e0","entry":"conv_nd","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"models/nn.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/models/nn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fe4eb545bbb728e0"}},{"code_sha256_prefix":"3e026dce22169267","entry":"get_optimizer","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/losses.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3e026dce22169267"}},{"code_sha256_prefix":"4d5a0650804371ce","entry":"get_timesteps_gan","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"distill_fm.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/distill_fm.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4d5a0650804371ce"}},{"code_sha256_prefix":"b6cf0eb0ba82bf62","entry":"get_weightings","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/losses.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b6cf0eb0ba82bf62"}},{"code_sha256_prefix":"913183cf9882fc5a","entry":"imread_uint","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/image_datasets.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/image_datasets.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"913183cf9882fc5a"}},{"code_sha256_prefix":"19892367876e0b4f","entry":"numpy_to_pil","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fid.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fid.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"19892367876e0b4f"}},{"code_sha256_prefix":"4c3fe3149cfaaedc","entry":"optimization_manager","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/losses.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/losses.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4c3fe3149cfaaedc"}},{"code_sha256_prefix":"75981a871aba8899","entry":"pil_to_numpy","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fid.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fid.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"75981a871aba8899"}},{"code_sha256_prefix":"7b7201c90355cb09","entry":"translate2d","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/augment.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/augment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7b7201c90355cb09"}},{"code_sha256_prefix":"8137c1b6cc279011","entry":"translate3d","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"fm/augment.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/fm/augment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8137c1b6cc279011"}},{"code_sha256_prefix":"142f5e900ff3ed99","entry":"unet_enc_forward","repo":"yuanzhi-zhu/oftsr","repo_kind":"official","path":"models/unet.py","file_url":"https://github.com/yuanzhi-zhu/oftsr/blob/HEAD/models/unet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"142f5e900ff3ed99"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}