[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-1933":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":8,"pushedAt":8,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":12,"lastSyncTime":27,"discoverSource":28},1933,"RefineAnything","limuloo\u002FRefineAnything","limuloo",null,"Python",197,9,2,7,0,5,10,37,15,55.7,false,"main",true,[],"2026-06-12 04:00:12","# RefineAnything\n\n**Multimodal Region-Specific Refinement for Perfect Local Details**\n\n\u003Ca href=\"https:\u002F\u002Flimuloo.github.io\u002FRefineAnything\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Page-blue\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2604.06870\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2604.06870-b31b1b\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Flimuloo\u002FRefineAnything\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGitHub-Code-black?logo=github\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Flimuloo1999\u002FRefineAnything\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHuggingFace-Checkpoint-yellow?logo=huggingface\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Flimuloo1999\u002FRefineAnything\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHuggingFace-Space-orange?logo=huggingface\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsmthemex\u002FComfyUI_RefineAnything\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FComfyUI-Plugin-green?logo=github\" \u002F>\u003C\u002Fa>\n\nRefineAnything targets **region-specific image refinement**: given an input image and a user-specified region (e.g., scribble mask or bounding box), it restores fine-grained details—text, logos, thin structures—while keeping **all non-edited pixels unchanged**. It supports both **reference-based** and **reference-free** refinement.\n\n![Teaser](docs\u002Fstatic\u002Fteaser.png)\n---\n\n## News\n- **2026-04-21** — **Environment pinning update.** For best results (and to avoid color shifts), please use **exactly** the versions pinned in `requirement.txt`: `diffusers==0.36.0`, `transformers==4.55.0`, `safetensors==0.5.3`, `peft==0.17.0`. See [Environment Notice](#environment-notice) below for a visual comparison.\n- **2026-04-21** — **Hugging Face Space environment fixed.** The online demo now runs on the correct dependency versions, so refinement results are noticeably better: \u003Chttps:\u002F\u002Fhuggingface.co\u002Fspaces\u002Flimuloo1999\u002FRefineAnything>.\n- **2026-04-14** — Community ComfyUI integration by [@smthemex](https:\u002F\u002Fgithub.com\u002Fsmthemex): [ComfyUI_RefineAnything](https:\u002F\u002Fgithub.com\u002Fsmthemex\u002FComfyUI_RefineAnything). Thanks for the great work!\n- **2026-04-14** — Local Gradio demo (`app.py`) is available for interactive testing.\n- **2026-04-12** — Hugging Face Space demo is live: \u003Chttps:\u002F\u002Fhuggingface.co\u002Fspaces\u002Flimuloo1999\u002FRefineAnything>.\n- **2026-04-09** — Checkpoint released on Hugging Face: \u003Chttps:\u002F\u002Fhuggingface.co\u002Flimuloo1999\u002FRefineAnything>.\n- **2026-04-09** — Release inference scripts.\n- **2026-04-08** — Documentation skeleton added; **code release coming this month** (inference scripts, environment, and checkpoints will be linked here).\n- **TBD** — Checkpoints and training\u002Fevaluation resources will be announced once finalized.\n\n---\n\n## Highlights\n\n- **Region-accurate refinement** — Explicit region cues (scribbles or boxes) steer edits to the target area.\n- **Reference-based and reference-free** — Optional reference image for guided local detail recovery.\n- **Strict background preservation** — Edits stay inside the target region; training emphasizes seamless boundaries.\n\n---\n\n## Comparisons\n\n![Reference-free qualitative comparisons](docs\u002Fstatic\u002Fqualitative_free.png)\n\n![Reference-based qualitative comparisons](docs\u002Fstatic\u002Fqualitative_reference.png)\n\n---\n\n## Installation\n\n```bash\npip install -r requirement.txt\n```\n\n> **Important — pin these versions exactly.** RefineAnything is sensitive to small numerical differences in the underlying libraries. Please install **exactly** the versions below; using newer or older releases can cause visible artifacts such as color shifts in the refined region.\n>\n> ```\n> diffusers==0.36.0\n> transformers==4.55.0\n> safetensors==0.5.3\n> peft==0.17.0\n> ```\n\n---\n\n## Environment Notice\n\nWe have observed that mismatched versions of `diffusers` \u002F `transformers` \u002F `safetensors` \u002F `peft` can introduce **color shifts** in the refined region, even when everything else is identical. The example below uses the prompt *\"remove the hand\"*:\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd align=\"center\">\u003Cb>Input (masked region = hand)\u003C\u002Fb>\u003C\u002Ftd>\n\u003Ctd align=\"center\">\u003Cb>Correct environment\u003C\u002Fb>\u003C\u002Ftd>\n\u003Ctd align=\"center\">\u003Cb>Wrong environment (color shift)\u003C\u002Fb>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Cimg src=\"docs\u002Fstatic\u002Fenv_check_input.png\" width=\"100%\">\u003C\u002Ftd>\n\u003Ctd>\u003Cimg src=\"docs\u002Fstatic\u002Fcorrect_env_result.png\" width=\"100%\">\u003C\u002Ftd>\n\u003Ctd>\u003Cimg src=\"docs\u002Fstatic\u002Fwrong_env_result.png\" width=\"100%\">\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\nIf your output shows a mild color\u002Ftone mismatch inside the mask while the rest of the image looks fine, the first thing to check is your package versions.\n\n---\n\n## Quick Start\n\nOnly **three** things are required to run RefineAnything:\n\n| Argument | Description |\n|----------|-------------|\n| `--input` | Source image |\n| `--mask` | Binary mask (white = region to refine) |\n| `--prompt` | What to refine |\n| `--ref` | *(optional)* Reference image for guided refinement |\n\n---\n\n### Demo 1 — Reference-based Logo Refinement\n\nRefine a blurry logo on a pillow using a reference image.\n\n```bash\npython scripts\u002Ffast_inference.py \\\n    --input  src\u002Finput1.png \\\n    --mask   src\u002Fmask1.png \\\n    --prompt \"Refine the LOGO.\" \\\n    --ref    src\u002Fref1.png \\\n    --output output\u002Fdemo1.png\n```\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd align=\"center\">\u003Cb>Input\u003C\u002Fb>\u003C\u002Ftd>\n\u003Ctd align=\"center\">\u003Cb>Reference\u003C\u002Fb>\u003C\u002Ftd>\n\u003Ctd align=\"center\">\u003Cb>Prompt\u003C\u002Fb>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Cimg src=\"docs\u002Fstatic\u002Fdemo1_input_zoom.jpg\" width=\"100%\">\u003C\u002Ftd>\n\u003Ctd>\u003Cimg src=\"src\u002Fref1.png\" width=\"100%\">\u003C\u002Ftd>\n\u003Ctd>\u003Ci>\"Refine the LOGO.\"\u003C\u002Fi>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd align=\"center\" colspan=\"3\">\u003Cb>Output\u003C\u002Fb>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd colspan=\"3\">\u003Cimg src=\"docs\u002Fstatic\u002Fdemo1_output_zoom.jpg\" width=\"100%\">\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n---\n\n### Demo 2 — Reference-free Text Refinement\n\nRefine blurry Chinese text on a building sign — no reference image needed.\n\n```bash\npython scripts\u002Ffast_inference.py \\\n    --input  src\u002Finput2.png \\\n    --mask   src\u002Fmask2.png \\\n    --prompt \"refine the text '鼎好商城'\" \\\n    --output output\u002Fdemo2.png\n```\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd align=\"center\">\u003Cb>Input\u003C\u002Fb>\u003C\u002Ftd>\n\u003Ctd align=\"center\">\u003Cb>Prompt\u003C\u002Fb>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Cimg src=\"docs\u002Fstatic\u002Fdemo2_input_zoom.jpg\" width=\"100%\">\u003C\u002Ftd>\n\u003Ctd>\u003Ci>\"refine the text '鼎好商城'\"\u003C\u002Fi>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd align=\"center\" colspan=\"2\">\u003Cb>Output\u003C\u002Fb>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd colspan=\"2\">\u003Cimg src=\"docs\u002Fstatic\u002Fdemo2_output_zoom.jpg\" width=\"100%\">\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n---\n\n## Local Gradio Demo\n\nWe also provide a Gradio-based web UI for interactive testing. You can brush regions, upload reference images, and adjust all inference parameters in the browser.\n\n```bash\npython app.py\n```\n\nThen open `http:\u002F\u002Flocalhost:7860` in your browser. The app will automatically download the base model (`Qwen\u002FQwen-Image-Edit-2511`) and the RefineAnything LoRA from Hugging Face on first launch.\n\nYou can specify a custom base model path via the `MODEL_DIR` environment variable:\n\n```bash\nMODEL_DIR=\u002Fpath\u002Fto\u002Flocal\u002FQwen-Image-Edit-2511 python app.py\n```\n\n**Features of the Gradio demo:**\n- **Brush-to-select**: paint directly on the source image to define the refinement region.\n- **Optional reference image**: upload a second image and optionally brush to crop a specific reference area.\n- **Focus crop**: automatically crops and zooms into the edit region for higher detail fidelity, then composites back seamlessly.\n- **Lightning LoRA**: one-click toggle for faster inference with fewer steps.\n- **Before \u002F After slider**: instantly compare input and output.\n\n---\n\n## Citation\n\nIf you use this repository, please cite:\n\n```bibtex\n@article{zhou2026refineanything,\n  title={RefineAnything: Multimodal Region-Specific Refinement for Perfect Local Details},\n  author={Zhou, Dewei and Li, You and Yang, Zongxin and Yang, Yi},\n  journal={arXiv preprint arXiv:2604.06870},\n  year={2026}\n}\n```\n\n---\n\n## Acknowledgements and License\n\nRefineAnything builds on ideas and components from the broader diffusion and multimodal ecosystem (including **Qwen2.5-VL**, **Qwen-Image**, and latent diffusion with **VAE** + **MMDiT**). Base model weights and API terms are subject to their respective licenses—**verify compliance before redistributing checkpoints or derived weights**.\n\nRepository **code license**: *TBD* (e.g., Apache-2.0 or MIT)—set `LICENSE` when you open-source the implementation.\n","RefineAnything 是一个专注于特定区域图像精细化处理的工具。它允许用户通过指定区域（如涂鸦掩码或边界框）来恢复图像中的精细细节，例如文本、标志和细小结构，同时保持未编辑区域的像素不变。该项目支持基于参考图和无参考图两种模式下的细化操作，采用Python语言开发，并利用了diffusers、transformers等库实现其功能。适合需要对图片局部进行高质量修复而不影响整体效果的应用场景，比如照片编辑、设计制作等领域。","2026-06-11 02:46:55","CREATED_QUERY"]