[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2329":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":13,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":28,"discoverSource":29},2329,"MegaStyle","Tencent\u002FMegaStyle","Tencent","MegaStyle, 面向一致性与多样性的可扩展风格数据生成框架","https:\u002F\u002Fjeoyal.github.io\u002FMegaStyle\u002F",null,"Python",124,3,1,0,2,23,6,1.81,"Other",false,"main",true,[],"2026-06-12 02:00:40","# MegaStyle: Constructing Diverse and Scalable Style Dataset via Consistent Text-to-Image Style Mapping\n\n\u003Ca href='https:\u002F\u002Farxiv.org\u002Fabs\u002F2604.08364'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-2604.08364-b31b1b.svg'>\u003C\u002Fa> \n\u003Ca href='https:\u002F\u002Fjeoyal.github.io\u002FMegaStyle\u002F'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject-Page-Green'>\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fhuggingface.co\u002FGaojunyao\u002FMegaStyle'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Model-blue'>\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Ftencent\u002FMegaStyle-1.4M'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Dataset-blue'>\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fmodelscope.cn\u002Fmodels\u002Fjunyaogao\u002FMegaStyle'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Model&message=ModelScope&color=purple&logo=ModelScope'>\u003C\u002Fa>\n\u003Ca href='https:\u002F\u002Fmodelscope.cn\u002Fdatasets\u002FTencent-Hunyuan\u002FMegaStyle-1.4M'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Dataset&message=ModelScope&color=purple&logo=ModelScope'>\u003C\u002Fa>\n\n**MegaStyle** is a novel and scalable data curation pipeline that first explores consistent T2I style mapping ability from current large generative models to construct intra-style consistent, inter-style diverse and high-quality style dataset.\n\n**Your star is our fuel!  We're revving up the engines with it!** Check out our [project page](https:\u002F\u002Fjeoyal.github.io\u002FMegaStyle\u002F) for more visual results!\n\n\u003Cimg src=\"assets\u002Fteaser.png\">\n\n## News\n- [2026\u002F4\u002F23] 🔥 We release a [Gradio demo](.\u002Fgradio_demo.py) and [ComfyUI custom nodes](.\u002Fcomfyui\u002F) (with a ready-to-use [workflow](.\u002Fcomfyui\u002Fworkflow_megastyle.json)) for style transfer using MegaStyle-FLUX.\n- [2026\u002F4\u002F22] 🔥 Thanks to [@olfronar](https:\u002F\u002Fgithub.com\u002Folfronar)'s contribution! The style score computation using MegaStyle-Encoder is now available on [HF space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Folfronar\u002Fmegastyle-comparison).\n- [2026\u002F4\u002F21] 🔥 We release the training\u002Finference codes, [models](https:\u002F\u002Fhuggingface.co\u002FGaojunyao\u002FMegaStyle) and [dataset](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Ftencent\u002FMegaStyle-1.4M) of MegaStyle!!!\n\n## TODO List\n- [ ] A more diverse and larger-scale style dataset.\n\n## MegaStyle-1.4M\n[MegaStyle-1.4M](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Ftencent\u002FMegaStyle-1.4M) is a large-scale style dataset built through a scalable pipeline that leverages consistent text-to-image style mapping of Qwen-Image. It combines 170K curated style prompts with 400K content prompts to generate 1.4M high-quality images that share strong intra-style consistency while covering diverse fine-grained styles.\n\u003Cimg src=\"assets\u002Fmegastyle1.4M.jpeg\">\n\n\n## Get Started\nTrained on MegaStyle1.4M, we introduce MegaStyle-FLUX and MegaStyle-Encoder for generalizable style transfer and reliable style similarity measurement.\n### Clone the Repository\n\n```\ngit clone git@github.com:Tencent\u002FMegaStyle.git\ncd .\u002FMegaStyle\n```\n\n### Environment Setup\n```\nconda create -n megastyle python==3.10\nconda activate megastyle\npip install diffsynth==1.1.8\n```\n\n### Downloading Checkpoints\n\n1. Download the pretrained models of [SigLIP](https:\u002F\u002Fhuggingface.co\u002Fgoogle\u002Fsiglip-so400m-patch14-384) and [FLUX.1-dev](https:\u002F\u002Fhuggingface.co\u002Fblack-forest-labs\u002FFLUX.1-dev).\n\n2. Download the [models](https:\u002F\u002Fhuggingface.co\u002FGaojunyao\u002FMegaStyle) into `.\u002Fmodels\u002F`. \n\n### Running Inference\nFor image style transfer, we provide 50 reference style images from \u003Ca href='https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1Q_jbI25NfqZvuwWv53slmovqyW_L4k2r\u002Fview?usp=drive_link'>StyleBench\u003C\u002Fa> in `.\u002Fref_styles`:\n```\npython inference.py --ckpt_path models\u002Fmegastyle_flux.safetensors --ref_path .\u002Fref_styles\n```\nFor computing style score:\n```\npython style_score.py --ckpt_path models\u002Fmegastyle_encoder.pth --real_image_path \u003Cpath\u002Fto\u002Fimage.png> --fake_image_path \u003Cpath\u002Fto\u002Fimage.png>\n```\n\n### Gradio Demo\nAn interactive web UI is provided via [`gradio_demo.py`](.\u002Fgradio_demo.py).\nInstall Gradio and launch:\n```\npip install gradio\npython gradio_demo.py --ckpt_path models\u002Fmegastyle_flux.safetensors --ref_path .\u002Fref_styles\n```\nThen open http:\u002F\u002Flocalhost:8080 in your browser. Upload a reference style image,\ntype a content prompt, and click **Generate**. Common options:\n```\npython gradio_demo.py \\\n    --ckpt_path models\u002Fmegastyle_flux.safetensors \\\n    --ref_path .\u002Fref_styles \\\n    --server_name 0.0.0.0 --server_port 8080 [--share]\n```\n\n### ComfyUI Custom Nodes\nCustom nodes live in `.\u002Fcomfyui\u002F` and, together with the shipped\n[`workflow_megastyle.json`](.\u002Fcomfyui\u002Fworkflow_megastyle.json), make MegaStyle\navailable as a drop-in graph inside [ComfyUI](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI).\nThe exposed nodes mirror a standard Flux workflow:\n\n- **Models Loader** — loads FLUX.1-dev into a `FluxImagePipeline`.\n- **MegaStyle LoRA Loader** — patches the MegaStyle-FLUX LoRA onto the DiT.\n- **Reference Style** — `LoadImage` input for the style reference.\n- **Text Encode** — CLIP + T5 prompt encoding.\n- **VAE Encode** — encodes the reference style image into latents.\n- **Flow Matching Scheduler** — denoise loop with `enable_shift_rope=True`.\n- **VAE Decode** — decodes latents back to an image.\n- **Save Image** — writes results to `output\u002FMegaStyle\u002F`.\n\n#### 1. Clone & install ComfyUI (skip if you already have one)\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI.git\ncd ComfyUI\nconda activate megastyle            # reuse the MegaStyle env (needs diffsynth==1.1.8)\npip install -r requirements.txt\ncd ..\n```\n\n#### 2. Register the MegaStyle node package\nFrom the MegaStyle repo root (so that `flux_image_mega.py` stays importable):\n```\n# Option A (recommended): symlink the comfyui package directly.\nln -s \"$(pwd)\u002Fcomfyui\" \u002Fpath\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002FMegaStyle\n\n# Option B: symlink the whole repo, then drop a one-line shim.\nln -s \"$(pwd)\" \u002Fpath\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002FMegaStyle\necho 'from .comfyui import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS' \\\n    > \u002Fpath\u002Fto\u002FComfyUI\u002Fcustom_nodes\u002FMegaStyle\u002F__init__.py\n```\n\nOn first launch the package will also:\n- copy `comfyui\u002Fworkflow_megastyle.json` to `ComfyUI\u002Fuser\u002Fdefault\u002Fworkflows\u002FMegaStyle.json`\n  so it shows up in the **Workflows** side panel;\n- symlink `ref_styles\u002F*.jpg` into `ComfyUI\u002Finput\u002F` so the default `LoadImage`\n  node resolves `00.jpg` out of the box.\n\nDisable with `MEGASTYLE_AUTO_INSTALL_WORKFLOW=0` \u002F `MEGASTYLE_AUTO_INSTALL_REFS=0`.\nIf auto-discovery of the ComfyUI root fails, set `MEGASTYLE_COMFY_ROOT=\u002Fpath\u002Fto\u002FComfyUI`.\n\n#### 3. Launch & run\n```\ncd \u002Fpath\u002Fto\u002FComfyUI\npython main.py --listen 0.0.0.0 --port 8080\n```\nOpen `http:\u002F\u002Flocalhost:8080`, pick the **MegaStyle** workflow from the\n*Workflows* panel, then click **Queue Prompt**. The default `lora_path` is\n`models\u002Fmegastyle_flux.safetensors` (resolved relative to the MegaStyle\nrepo root); set it to an absolute path if you keep the checkpoint\nelsewhere.\nSee [`.\u002Fcomfyui\u002FREADME.md`](.\u002Fcomfyui\u002FREADME.md) for the wiring diagram and\nadvanced options (CFG, custom negative prompts, etc.).\n\n### Training\nTo train a style transfer model with paired supervision, please download our style dataset, [MegaStyle1.4M](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Ftencent\u002FMegaStyle-1.4M), and start training with:\n```\nbash FLUX.1-dev.sh # FLUX.1-dev-npu.sh for npu\n```\n\n## License and Citation\nAll assets and code are under the [license](.\u002FLICENSE.txt) unless specified otherwise.\n\nIf this work is helpful for your research, please consider citing the following BibTeX entry.\n```\n@article{gao2026megastyle,\n  title={MegaStyle: Constructing Diverse and Scalable Style Dataset via Consistent Text-to-Image Style Mapping},\n  author={Gao, Junyao and Liu, Sibo and Li, Jiaxing and Sun, Yanan and Tu, Yuanpeng and Shen, Fei and Zhang, Weidong and Zhao, Cairong and Zhang, Jun},\n  journal={arXiv preprint arXiv:2604.08364},\n  year={2026}\n}\n```\n\n## Acknowledgements\nThe code is built upon [DiffSynth-Studio](https:\u002F\u002Fgithub.com\u002Fmodelscope\u002FDiffSynth-Studio).","MegaStyle 是一个面向一致性和多样性的可扩展风格数据生成框架。该项目通过探索当前大型生成模型的一致性文本到图像风格映射能力，构建了具有内部风格一致性、跨风格多样性和高质量的风格数据集。核心技术包括使用Qwen-Image进行一致性的文本到图像风格映射，并结合170K精心策划的风格提示与400K内容提示生成1.4M张高质图像。此外，MegaStyle还提供了MegaStyle-FLUX和MegaStyle-Encoder工具，分别用于通用风格迁移和可靠的风格相似度测量。此项目适用于需要大量且多样化视觉风格数据的研究者及开发者，特别是在图像生成、风格迁移等领域。","2026-06-11 02:49:32","CREATED_QUERY"]