{"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/promptfix-you-prompt-and-we-fix-the-photo","title":"PromptFix: You Prompt and We Fix the Photo","arxiv_id":"2405.16785","date":"2024-05-27","proceeding":null,"authors":["Yongsheng Yu","Ziyun Zeng","Hang Hua","Jianlong Fu","Jiebo Luo"],"abstract":"Diffusion models equipped with language models demonstrate excellent controllability in image generation tasks, allowing image processing to adhere to human instructions. However, the lack of diverse instruction-following data hampers the development of models that effectively recognize and execute user-customized instructions, particularly in low-level tasks. Moreover, the stochastic nature of the diffusion process leads to deficiencies in image generation or editing tasks that require the detailed preservation of the generated images. To address these limitations, we propose PromptFix, a comprehensive framework that enables diffusion models to follow human instructions to perform a wide variety of image-processing tasks. First, we construct a large-scale instruction-following dataset that covers comprehensive image-processing tasks, including low-level tasks, image editing, and object creation. Next, we propose a high-frequency guidance sampling method to explicitly control the denoising process and preserve high-frequency details in unprocessed areas. Finally, we design an auxiliary prompting adapter, utilizing Vision-Language Models (VLMs) to enhance text prompts and improve the model's task generalization. Experimental results show that PromptFix outperforms previous methods in various image-processing tasks. Our proposed model also achieves comparable inference efficiency with these baseline models and exhibits superior zero-shot capabilities in blind restoration and combination tasks. The dataset and code are available at https://www.yongshengyu.com/PromptFix-Page.","url_abs":"https://arxiv.org/abs/2405.16785v2","url_pdf":"https://arxiv.org/pdf/2405.16785v2.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":"promptfix-you-prompt-and-we-fix-the-photo","repo_url":"https://github.com/yeates/promptfix","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"instruction-following","task_name":"Instruction Following"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2405.16785","atlas_url":"https://app.syntology.ai/?focus=2405.16785","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.16785"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/yeates/promptfix","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"ran_violates":2,"ran_honours":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":13,"ran":10,"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":"11dc9180f4f7bf80","entry":"auto_resume_helper","repo":"yeates/promptfix","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","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":"11dc9180f4f7bf80"}},{"code_sha256_prefix":"387280193dfae9c0","entry":"decode_image","repo":"yeates/promptfix","repo_kind":"official","path":"dataset/promptfix_data.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/dataset/promptfix_data.py","link_basis":"first_harvest_node","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":"387280193dfae9c0"}},{"code_sha256_prefix":"424012cb37b31172","entry":"default","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/ldm/modules/attention.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/ldm/modules/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"424012cb37b31172"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/ldm/modules/attention.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/ldm/modules/attention.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aa5486a3650902d8"}},{"code_sha256_prefix":"ba80edd5be064d4b","entry":"extract_high_freq_component","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/ldm/hfp.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/ldm/hfp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ba80edd5be064d4b"}},{"code_sha256_prefix":"eec1e7cba51d5e8e","entry":"get_grad_norm","repo":"yeates/promptfix","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"eec1e7cba51d5e8e"}},{"code_sha256_prefix":"e8c2b1b2c48f6fe8","entry":"high_pass_filter","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/ldm/hfp.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/ldm/hfp.py","link_basis":"first_harvest_node","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":"e8c2b1b2c48f6fe8"}},{"code_sha256_prefix":"96a581cf6a8085f9","entry":"resize_image_to_resolution","repo":"yeates/promptfix","repo_kind":"official","path":"process_images_json.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/process_images_json.py","link_basis":"first_harvest_node","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":"96a581cf6a8085f9"}},{"code_sha256_prefix":"e70da51cefb1bb66","entry":"rgb_to_grayscale","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/ldm/hfp.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/ldm/hfp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e70da51cefb1bb66"}},{"code_sha256_prefix":"9a299fe5ae09e407","entry":"uniq","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/ldm/modules/attention.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/ldm/modules/attention.py","link_basis":"harvester_set","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":"9a299fe5ae09e407"}},{"code_sha256_prefix":"80450600f7f09b0a","entry":"create_logger","repo":"yeates/promptfix","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/utils/logger.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":"80450600f7f09b0a"}},{"code_sha256_prefix":"4533e43e06a12dc5","entry":"download_models","repo":"yeates/promptfix","repo_kind":"official","path":"stable_diffusion/notebook_helpers.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/stable_diffusion/notebook_helpers.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":"4533e43e06a12dc5"}},{"code_sha256_prefix":"4531730599ba8582","entry":"load_checkpoint","repo":"yeates/promptfix","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/yeates/promptfix/blob/HEAD/utils/utils.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":"4531730599ba8582"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}