{"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/fireflow-fast-inversion-of-rectified-flow-for","title":"FireFlow: Fast Inversion of Rectified Flow for Image Semantic Editing","arxiv_id":"2412.07517","date":"2024-12-10","proceeding":null,"authors":["Yingying Deng","Xiangyu He","Changwang Mei","Peisong Wang","Fan Tang"],"abstract":"Though Rectified Flows (ReFlows) with distillation offers a promising way for fast sampling, its fast inversion transforms images back to structured noise for recovery and following editing remains unsolved. This paper introduces FireFlow, a simple yet effective zero-shot approach that inherits the startling capacity of ReFlow-based models (such as FLUX) in generation while extending its capabilities to accurate inversion and editing in $8$ steps. We first demonstrate that a carefully designed numerical solver is pivotal for ReFlow inversion, enabling accurate inversion and reconstruction with the precision of a second-order solver while maintaining the practical efficiency of a first-order Euler method. This solver achieves a $3\\times$ runtime speedup compared to state-of-the-art ReFlow inversion and editing techniques, while delivering smaller reconstruction errors and superior editing results in a training-free mode. The code is available at $\\href{https://github.com/HolmesShuan/FireFlow}{this URL}$.","url_abs":"https://arxiv.org/abs/2412.07517v1","url_pdf":"https://arxiv.org/pdf/2412.07517v1.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":"fireflow-fast-inversion-of-rectified-flow-for","repo_url":"https://github.com/holmesshuan/fireflow","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"text-based-image-editing","task_name":"Text-based Image Editing"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/text-based-image-editing-on-pie-bench","task":"Text-based Image Editing","dataset":"PIE-Bench","model":"FireFlow","rank_in_archive_order":10,"of":18,"metrics":{"Background LPIPS":"123.6","Background PSNR":"23.03","CLIPSIM":"26.02","Structure Distance":"27.1"},"uses_additional_data":false},{"leaderboard":"/sota/text-based-image-editing-on-pie-bench","task":"Text-based Image Editing","dataset":"PIE-Bench","model":"FireFlow (Add Q)","rank_in_archive_order":18,"of":18,"metrics":{"Background LPIPS":"239.4","Background PSNR":"16.49","CLIPSIM":"27.33","Structure Distance":"70.9"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2412.07517","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.07517"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/holmesshuan/fireflow","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":3,"ran_fixture":1,"unverified":7},"by_repo_kind":{"official":{"samples":11,"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":"3f6652da855a2ea0","entry":"get_lin_function","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/sampling.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/sampling.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3f6652da855a2ea0"}},{"code_sha256_prefix":"17724d4203fa5863","entry":"rope","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/math.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/math.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"17724d4203fa5863"}},{"code_sha256_prefix":"5fb036462ae82f9f","entry":"swish","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/modules/autoencoder.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/modules/autoencoder.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5fb036462ae82f9f"}},{"code_sha256_prefix":"0a1aadb08bf169c1","entry":"timestep_embedding","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/modules/layers.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/modules/layers.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0a1aadb08bf169c1"}},{"code_sha256_prefix":"3444bbcc9065f707","entry":"apply_rope","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/math.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/math.py","link_basis":"plan_row","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":"3444bbcc9065f707"}},{"code_sha256_prefix":"b17d74354ecaf7fe","entry":"attention","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/math.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/math.py","link_basis":"plan_row","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":"b17d74354ecaf7fe"}},{"code_sha256_prefix":"e6761d87b84f732c","entry":"calculate_mse","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/calculate_reconstruction_error.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/calculate_reconstruction_error.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":"e6761d87b84f732c"}},{"code_sha256_prefix":"1498dfc442c71ecc","entry":"encode","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/edit.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/edit.py","link_basis":"plan_row","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":"1498dfc442c71ecc"}},{"code_sha256_prefix":"e02de920391fa756","entry":"encode","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/gradio_demo.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/gradio_demo.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":"e02de920391fa756"}},{"code_sha256_prefix":"dcadced4a54cb3e8","entry":"extract_steps_from_filename","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/calculate_reconstruction_error.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/calculate_reconstruction_error.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":"dcadced4a54cb3e8"}},{"code_sha256_prefix":"9f391f7c45a5bc94","entry":"time_shift","repo":"holmesshuan/fireflow","repo_kind":"official","path":"src/flux/sampling.py","file_url":"https://github.com/holmesshuan/fireflow/blob/HEAD/src/flux/sampling.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":"9f391f7c45a5bc94"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}