[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-bytedance--USO":3,"tool-bytedance--USO":62},[4,18,26,35,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,2,"2026-04-10T11:39:34",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":32,"last_commit_at":41,"category_tags":42,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[43,13,15,14],"插件",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[52,15,13,14],"语言模型",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,61],"视频",{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":10,"env_os":90,"env_gpu":91,"env_ram":90,"env_deps":92,"category_tags":99,"github_topics":77,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":100,"updated_at":101,"faqs":102,"releases":108},7978,"bytedance\u002FUSO","USO","[CVPR 2026] 🔥🔥 Official Repo of USO: Unified Style and Subject-Driven Generation via Disentangled and Reward Learning","USO 是由字节跳动智能创作实验室推出的开源 AI 图像生成框架，旨在统一解决“风格迁移”与“主体保持”这两大传统上相互冲突的任务。以往的技术往往顾此失彼：强调风格时容易丢失主体特征，而聚焦主体时又难以完美复刻目标风格。USO 通过构建大规模三元组数据集，创新性地引入了解耦学习机制，将图像中的“内容”与“风格”特征有效分离并重新组合。此外，它还结合了风格奖励学习范式，进一步提升了生成图像的质感与一致性。\n\n该项目不仅发布了完整的技术报告和训练代码，还原生支持 ComfyUI 工作流，并提供了显存优化模式（FP8），使得消费级显卡用户也能轻松体验。无论是希望深入探索多模态生成算法的研究人员、需要高效工作流整合的开发者，还是追求高质量创意输出的设计师，USO 都能提供强大的支持。它打破了风格与主体生成的界限，让创作者能够更自由地控制图像内容与艺术风格，实现真正可控的个性化图像生成。","\u003Ch3 align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_aa363a93cb1b.webp\" alt=\"Logo\" style=\"vertical-align: middle; width: 95px; height: auto;\">\n    \u003C\u002Fbr>\n    Unified Style and Subject-Driven Generation via Disentangled and Reward Learning\n\u003C\u002Fh3>\n\n\u003Cp align=\"center\"> \n\u003Ca href=\"https:\u002F\u002Fbytedance.github.io\u002FUSO\u002F\">\u003Cimg alt=\"Build\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject%20Page-USO-blue\">\u003C\u002Fa> \n\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.18966\">\u003Cimg alt=\"Build\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTech%20Report-USO-b31b1b.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fbytedance-research\u002FUSO\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=%F0%9F%A4%97%20Hugging%20Face&message=Model&color=green\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fbytedance-research\u002FUSO\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=%F0%9F%A4%97%20Hugging%20Face&message=demo&color=orange\">\u003C\u002Fa>\n\u003C\u002Fp>\n\u003C\u002Fp>\n\n>\u003Cp align=\"center\"> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Shaojin Wu,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa>  \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Mengqi Huang,\u003C\u002Fspan>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Yufeng Cheng,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa>  \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Wenxu Wu,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup> \u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Jiahe Tian,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Yiming Luo,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Fei Ding,\u003C\u002Fspan>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">Qian He\u003C\u002Fspan>\u003C\u002Fa> \u003Cbr> \n>\u003Cspan style=\"font-size: 13.5px\">UXO Team\u003C\u002Fspan>\u003Cbr> \n>\u003Cspan style=\"font-size: 12px\">Intelligent Creation Lab, Bytedance\u003C\u002Fspan>\u003C\u002Fp>\n\n### 🚩 Updates\n* **2025.09.12** 🔥 Our new family member [UMO](https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUMO) is here! It focuses on multiple identities and subject-driven generation. You can visit the \u003Ca href=\"https:\u002F\u002Fbytedance.github.io\u002FUMO\u002F\" target=\"_blank\">UMO project page\u003C\u002Fa> for more examples.\n\n* **2025.09.03** 🎉 USO is now natively supported in ComfyUI, see official tutorial [USO in ComfyUI](https:\u002F\u002Fdocs.comfy.org\u002Ftutorials\u002Fflux\u002Fflux-1-uso) and our provided examples in `.\u002Fworkflow`. More tips are available in the [README below](https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUSO#%EF%B8%8F-comfyui-examples).\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_3d686c551134.jpeg\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n* **2025.08.28** 🔥 The [demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fbytedance-research\u002FUSO) of USO is released. Try it Now! ⚡️\n* **2025.08.28** 🔥 Update fp8 mode as a primary low vmemory usage support (please scroll down). Gift for consumer-grade GPU users. The peak Vmemory usage is ~16GB now.\n* **2025.08.27** 🔥 The [inference code](https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUSO) and [model](https:\u002F\u002Fhuggingface.co\u002Fbytedance-research\u002FUSO) of USO are released.\n* **2025.08.27** 🔥 The [project page](https:\u002F\u002Fbytedance.github.io\u002FUSO) of USO is created.\n* **2025.08.27** 🔥 The [technical report](https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.18966) of USO is released.\n\n## 📖 Introduction\nExisting literature typically treats style-driven and subject-driven generation as two disjoint tasks: the former prioritizes stylistic similarity, whereas the latter insists on subject consistency, resulting in an apparent antagonism. We argue that both objectives can be unified under a single framework because they ultimately concern the disentanglement and re-composition of “content” and “style”, a long-standing theme in style-driven research. To this end, we present USO, a Unified framework for Style driven and subject-driven GeneratiOn. First, we construct a large-scale triplet dataset consisting of content images, style images, and their corresponding stylized content images. Second, we introduce a disentangled learning scheme that simultaneously aligns style features and disentangles content from style through two complementary objectives, style-alignment training and content–style disentanglement training. Third, we incorporate a style reward-learning paradigm to further enhance the model’s performance.\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_9b6c267f4ece.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\n## ⚡️ Quick Start\n\n### 🔧 Requirements and Installation\n\nInstall the requirements\n```bash\n## create a virtual environment with python >= 3.10 \u003C= 3.12, like\npython -m venv uso_env\nsource uso_env\u002Fbin\u002Factivate\n## or\nconda create -n uso_env python=3.10 -y\nconda activate uso_env\n\n## install torch\n## recommended version:\npip install torch==2.4.0 torchvision==0.19.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124 \n\n## then install the requirements by you need\npip install -r requirements.txt # legacy installation command\n```\n\nThen download checkpoints:\n```bash\n# 1. set up .env file\ncp example.env .env\n\n# 2. set your huggingface token in .env (open the file and change this value to your token)\nHF_TOKEN=your_huggingface_token_here\n\n#3. download the necessary weights (comment any weights you don't need)\npip install huggingface_hub\npython .\u002Fweights\u002Fdownloader.py\n```\n- **IF YOU HAVE WEIGHTS, COMMENT OUT WHAT YOU DON'T NEED IN .\u002Fweights\u002Fdownloader.py**\n\n### ✍️ Inference\n* Start from the examples below to explore and spark your creativity. ✨\n```bash\n# the first image is a content reference, and the rest are style references.\n\n# for subject-driven generation\npython inference.py --prompt \"The man in flower shops carefully match bouquets, conveying beautiful emotions and blessings with flowers. \" --image_paths \"assets\u002Fgradio_examples\u002Fidentity1.jpg\" --width 1024 --height 1024\n# for style-driven generation\n# please keep the first image path empty\npython inference.py --prompt \"A cat sleeping on a chair.\" --image_paths \"\" \"assets\u002Fgradio_examples\u002Fstyle1.webp\" --width 1024 --height 1024\n# for style-subject driven generation (or set the prompt to empty for layout-preserved generation)\npython inference.py --prompt \"The woman gave an impassioned speech on the podium.\" --image_paths \"assets\u002Fgradio_examples\u002Fidentity2.webp\" \"assets\u002Fgradio_examples\u002Fstyle2.webp\" --width 1024 --height 1024\n# for multi-style generation\n# please keep the first image path empty\npython inference.py --prompt \"A handsome man.\" --image_paths \"\" \"assets\u002Fgradio_examples\u002Fstyle3.webp\" \"assets\u002Fgradio_examples\u002Fstyle4.webp\" --width 1024 --height 1024\n\n# for low vram:\npython inference.py --prompt \"your propmt\" --image_paths \"your_image.jpg\" --width 1024 --height 1024 --offload --model_type flux-dev-fp8 \n```\n* You can also compare your results with the results in the `assets\u002Fgradio_examples` folder.\n\n* For more examples, visit our [project page](https:\u002F\u002Fbytedance.github.io\u002FUSO) or try the live [demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fbytedance-research\u002FUSO).\n\n### 🌟 Gradio Demo\n\n```bash\npython app.py\n```\n\n**For low vmemory usage**, please pass the `--offload` and `--name flux-dev-fp8` args. The peak memory usage will be 16GB (Single reference) ~ 18GB (Multi references).\n\n```bash\n# please use FLUX_DEV_FP8 replace FLUX_DEV\nexport FLUX_DEV_FP8=\"YOUR_FLUX_DEV_PATH\"\n\npython app.py --offload --name flux-dev-fp8\n```\n\n## 🌈 More examples\nWe provide some prompts and results to help you better understand the model. You can check our [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.18966) or [project page](https:\u002F\u002Fbytedance.github.io\u002FUSO\u002F) for more visualizations.\n\n#### Subject\u002FIdentity-driven generation\n\u003Cdetails>\n\u003Csummary>If you want to place a subject into new scene, please use natural language like \"A dog\u002Fman\u002Fwoman is doing...\". If you only want to transfer the style but keep the layout, please an use instructive prompt like \"Transform the style into ... style\". For portraits-preserved generation, USO excels at producing high skin-detail images. A practical guideline: use half-body close-ups for half-body prompts, and full-body images when the pose or framing changes significantly. \u003C\u002Fsummary>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_3f425f0ef71a.webp\" width=\"1024\"\u002F>\n\u003Cp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_1e9c84dada27.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_5fbccd2a1ee2.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_7cc887142e7f.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\n#### Style-driven generation\n\u003Cdetails>\n\u003Csummary>Just upload one or two style images, and use natural language to create want you want. USO will generate images follow your prompt and match the style you uploaded. \u003C\u002Fsummary>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_7a3f96e10f55.webp\" width=\"1024\"\u002F>\n\u003Cp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_f6ff427e6a4a.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n#### Style-subject driven generation\n\u003Cdetails>\n\u003Csummary>USO can stylize a single content reference with one or two style refs. For layout-preserved generation, just set the prompt to empty. \u003C\u002Fsummary>\n`Layout-preserved generation`\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_1ead2ba615b0.webp\" width=\"1024\"\u002F>\n\u003Cp>\n\n`Layout-shifted generation`\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_d11748328359.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n## ⚙️ ComfyUI examples\nWe’re pleased that USO now has native support in ComfyUI. For a quick start, please refer to the official tutorials [USO in ComfyUI](https:\u002F\u002Fdocs.comfy.org\u002Ftutorials\u002Fflux\u002Fflux-1-uso). To help you reproduce and match the results, we’ve provided several examples in `.\u002Fworkflows`, including **workflows** and their **inputs** and outputs, so you can quickly get familiar with what USO can do. With USO now fully compatible with the ComfyUI ecosystem, you can combine it with other plugins like ControlNet and LoRA. **We welcome community contributions of more workflows and examples.**\n\nNow you can easily run USO in ComfyUI. Just update ComfyUI to the latest version (0.3.57), and you’ll find USO in the official templates.\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_5c74835151de.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nMore examples are provided below:\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_46b6ed6babee.webp\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n**Identity preserved**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_41dde027142e.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nDownload the image above and drag it into ComfyUI to load the corresponding [workflow](workflow\u002Fexample1.json). Input images can be found in `.\u002Fworkflow`\n\n**Identity stylized**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_d38f78582d82.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nDownload the image above and drag it into ComfyUI to load the corresponding [workflow](workflow\u002Fexample3.json). Input images can be found in `.\u002Fworkflow`\n\n**Identity + style reference**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_ae461c387d7c.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nDownload the image above and drag it into ComfyUI to load the corresponding [workflow](workflow\u002Fexample2.json). Input images can be found in `.\u002Fworkflow`\n\n**Single style reference**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_6380df71e9c0.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nDownload the image above and drag it into ComfyUI to load the corresponding [workflow](workflow\u002Fexample4.json). Input images can be found in `.\u002Fworkflow`\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_f394b4511b04.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nDownload the image above and drag it into ComfyUI to load the corresponding [workflow](workflow\u002Fexample6.json). Input images can be found in `.\u002Fworkflow`\n\n**Multiple style reference**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_478bf4e0ca49.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\nDownload the image above and drag it into ComfyUI to load the corresponding [workflow](workflow\u002Fexample5.json). Input images can be found in `.\u002Fworkflow`\n\n## 📄 Disclaimer\n\u003Cp>\n  We open-source this project for academic research. The vast majority of images \n  used in this project are either generated or from open-source datasets. If you have any concerns, \n  please contact us, and we will promptly remove any inappropriate content. \n  Our project is released under the Apache 2.0 License. If you apply to other base models, \n  please ensure that you comply with the original licensing terms. \n  \u003Cbr>\u003Cbr>This research aims to advance the field of generative AI. Users are free to \n  create images using this tool, provided they comply with local laws and exercise \n  responsible usage. The developers are not liable for any misuse of the tool by users.\u003C\u002Fp>\n\n## 🚀 Updates\nFor the purpose of fostering research and the open-source community, we plan to open-source the entire project, encompassing training, inference, weights, dataset etc. Thank you for your patience and support! 🌟\n- [x] Release technical report.\n- [x] Release github repo.\n- [x] Release inference code.\n- [x] Release model checkpoints.\n- [x] Release huggingface space demo.\n- Release training code.\n- Release dataset.\n\n##  Citation\nIf USO is helpful, please help to ⭐ the repo.\n\nIf you find this project useful for your research, please consider citing our paper:\n```bibtex\n@article{wu2025uso,\n    title={USO: Unified Style and Subject-Driven Generation via Disentangled and Reward Learning},\n    author={Shaojin Wu and Mengqi Huang and Yufeng Cheng and Wenxu Wu and Jiahe Tian and Yiming Luo and Fei Ding and Qian He},\n    year={2025},\n    eprint={2508.18966},\n    archivePrefix={arXiv},\n    primaryClass={cs.CV},\n}\n```","\u003Ch3 align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_aa363a93cb1b.webp\" alt=\"Logo\" style=\"vertical-align: middle; width: 95px; height: auto;\">\n    \u003C\u002Fbr>\n    统一风格与主题驱动生成：基于解耦与奖励学习的方法\n\u003C\u002Fh3>\n\n\u003Cp align=\"center\"> \n\u003Ca href=\"https:\u002F\u002Fbytedance.github.io\u002FUSO\u002F\">\u003Cimg alt=\"Build\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject%20Page-USO-blue\">\u003C\u002Fa> \n\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.18966\">\u003Cimg alt=\"Build\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTech%20Report-USO-b31b1b.svg\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fbytedance-research\u002FUSO\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=%F0%9F%A4%97%20Hugging%20Face&message=Model&color=green\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fbytedance-research\u002FUSO\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=%F0%9F%A4%97%20Hugging%20Face&message=demo&color=orange\">\u003C\u002Fa>\n\u003C\u002Fp>\n\u003C\u002Fp>\n\n>\u003Cp align=\"center\"> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">吴绍进,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa>  \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">黄梦琪,\u003C\u002Fspan>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">程宇峰,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa>  \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">吴文旭,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup> \u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">田嘉禾,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">罗一鸣,\u003C\u002Fspan>\u003Csup>\u003C\u002Fsup>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">丁飞,\u003C\u002Fspan>\u003C\u002Fa> \u003Cspan style=\"color:#137cf3; font-family: Gill Sans\">何倩\u003C\u002Fspan>\u003C\u002Fa> \u003Cbr> \n>\u003Cspan style=\"font-size: 13.5px\">UXO团队\u003C\u002Fspan>\u003Cbr> \n>\u003Cspan style=\"font-size: 12px\">字节跳动智能创作实验室\u003C\u002Fspan>\u003C\u002Fp>\n\n### 🚩 更新\n* **2025.09.12** 🔥 我们的全新成员 [UMO](https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUMO) 来了！它专注于多身份和主题驱动的生成。更多示例请访问 \u003Ca href=\"https:\u002F\u002Fbytedance.github.io\u002FUMO\u002F\" target=\"_blank\">UMO 项目页面\u003C\u002Fa>。\n\n* **2025.09.03** 🎉 USO 现已原生支持 ComfyUI，详见官方教程 [USO 在 ComfyUI 中](https:\u002F\u002Fdocs.comfy.org\u002Ftutorials\u002Fflux\u002Fflux-1-uso)，并在 `.\u002Fworkflow` 中提供了我们的示例。更多技巧请参阅下方的 [README](https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUSO#%EF%B8%8F-comfyui-examples)。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_3d686c551134.jpeg\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n* **2025.08.28** 🔥 USO 的 [演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fbytedance-research\u002FUSO) 已发布。立即体验吧！⚡️\n* **2025.08.28** 🔥 更新了 fp8 模式，作为主要的低显存使用支持（请向下滚动）。这是送给消费级 GPU 用户的礼物。目前峰值显存占用约为 16GB。\n* **2025.08.27** 🔥 USO 的 [推理代码](https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUSO) 和 [模型](https:\u002F\u002Fhuggingface.co\u002Fbytedance-research\u002FUSO) 已发布。\n* **2025.08.27** 🔥 USO 的 [项目页面](https:\u002F\u002Fbytedance.github.io\u002FUSO) 已创建。\n* **2025.08.27** 🔥 USO 的 [技术报告](https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.18966) 已发布。\n\n## 📖 引言\n现有文献通常将风格驱动和主题驱动的生成视为两个独立的任务：前者优先考虑风格相似性，而后者则强调主题一致性，从而导致明显的对立。我们认为，这两个目标可以在一个统一的框架下实现，因为它们本质上都涉及“内容”和“风格”的解耦与重组，而这正是风格驱动研究中的一个长期主题。为此，我们提出了 USO——一种用于风格驱动和主题驱动生成的统一框架。首先，我们构建了一个大规模的三元组数据集，包含内容图像、风格图像及其对应的风格化内容图像。其次，我们引入了一种解耦学习方案，通过风格对齐训练和内容-风格解耦训练这两种互补的目标，同时对齐风格特征并实现内容与风格的解耦。最后，我们引入了风格奖励学习范式，以进一步提升模型性能。\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_9b6c267f4ece.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\n## ⚡️ 快速入门\n\n### 🔧 要求与安装\n\n安装所需依赖\n```bash\n## 创建一个 Python >= 3.10 \u003C= 3.12 的虚拟环境，例如：\npython -m venv uso_env\nsource uso_env\u002Fbin\u002Factivate\n## 或\nconda create -n uso_env python=3.10 -y\nconda activate uso_env\n\n## 安装 PyTorch\n## 推荐版本：\npip install torch==2.4.0 torchvision==0.19.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124 \n\n## 然后根据需要安装其他依赖\npip install -r requirements.txt # 传统安装命令\n```\n\n然后下载检查点：\n```bash\n# 1. 设置 .env 文件\ncp example.env .env\n\n# 2. 在 .env 文件中设置你的 Hugging Face Token（打开文件并将此值替换为你的 Token）\nHF_TOKEN=your_huggingface_token_here\n\n# 3. 下载必要的权重（如果你不需要某些权重，请注释掉）\npip install huggingface_hub\npython .\u002Fweights\u002Fdownloader.py\n```\n- **如果你已经有权重，请在 .\u002Fweights\u002Fdownloader.py 中注释掉不需要的部分**\n\n### ✍️ 推理\n* 从下面的示例开始，探索并激发你的创造力。✨\n```bash\n# 第一张图片是内容参考，其余的是风格参考。\n\n# 对于主题驱动的生成\npython inference.py --prompt \"花店里的男士细心搭配花束，用鲜花传递美好的情感与祝福。\" --image_paths \"assets\u002Fgradio_examples\u002Fidentity1.jpg\" --width 1024 --height 1024\n# 对于风格驱动的生成\n# 请保持第一张图片路径为空\npython inference.py --prompt \"一只猫正在椅子上睡觉。\" --image_paths \"\" \"assets\u002Fgradio_examples\u002Fstyle1.webp\" --width 1024 --height 1024\n# 对于风格-主题驱动的生成（或将提示留空以进行布局保留的生成）\npython inference.py --prompt \"这位女士在讲台上发表了激情洋溢的演讲。\" --image_paths \"assets\u002Fgradio_examples\u002Fidentity2.webp\" \"assets\u002Fgradio_examples\u002Fstyle2.webp\" --width 1024 --height 1024\n# 对于多风格生成\n# 请保持第一张图片路径为空\npython inference.py --prompt \"一位英俊的男士。\" --image_paths \"\" \"assets\u002Fgradio_examples\u002Fstyle3.webp\" \"assets\u002Fgradio_examples\u002Fstyle4.webp\" --width 1024 --height 1024\n\n# 对于低显存使用\npython inference.py --prompt \"你的提示\" --image_paths \"你的图片.jpg\" --width 1024 --height 1024 --offload --model_type flux-dev-fp8 \n```\n* 你也可以将自己的结果与 `assets\u002Fgradio_examples` 文件夹中的结果进行对比。\n\n* 更多示例请访问我们的 [项目页面](https:\u002F\u002Fbytedance.github.io\u002FUSO) 或尝试实时 [演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fbytedance-research\u002FUSO)。\n\n### 🌟 Gradio 演示\n\n```bash\npython app.py\n```\n\n**对于低显存使用**，請传入 `--offload` 和 `--name flux-dev-fp8` 参数。峰值内存占用将为 16GB（单参考）~ 18GB（多参考）。\n\n```bash\n# 请使用 FLUX_DEV_FP8 替代 FLUX_DEV\nexport FLUX_DEV_FP8=\"YOUR_FLUX_DEV_PATH\"\n\npython app.py --offload --name flux-dev-fp8\n```\n\n## 🌈 更多示例\n我们提供了一些提示词和生成结果，以帮助您更好地理解该模型。您可以查看我们的[论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2508.18966)或[项目页面](https:\u002F\u002Fbytedance.github.io\u002FUSO\u002F)获取更多可视化内容。\n\n#### 主题\u002F身份驱动的生成\n\u003Cdetails>\n\u003Csummary>如果您想将主体放置到新的场景中，请使用自然语言描述，例如“一只狗\u002F一位男士\u002F一位女士正在做……”。如果您只想迁移风格但保持布局不变，则可以使用指令型提示词，如“将风格转换为……风格”。对于保留人物特征的生成，USO在生成高细节皮肤图像方面表现出色。实用建议：对于半身提示词，使用半身特写；当姿势或构图发生显著变化时，则使用全身图像。\u003C\u002Fsummary>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_3f425f0ef71a.webp\" width=\"1024\"\u002F>\n\u003Cp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_1e9c84dada27.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_5fbccd2a1ee2.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_7cc887142e7f.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n\n#### 风格驱动的生成\n\u003Cdetails>\n\u003Csummary>只需上传一到两张风格参考图，并用自然语言描述您想要的内容。USO将根据您的提示词生成图像，并匹配您上传的风格。\u003C\u002Fsummary>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_7a3f96e10f55.webp\" width=\"1024\"\u002F>\n\u003Cp>\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_f6ff427e6a4a.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n#### 风格-主题驱动的生成\n\u003Cdetails>\n\u003Csummary>USO可以利用一到两张风格参考图对单一内容参考进行风格化处理。对于保持布局不变的生成，只需将提示词留空即可。\u003C\u002Fsummary>\n`布局保持不变的生成`\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_1ead2ba615b0.webp\" width=\"1024\"\u002F>\n\u003Cp>\n\n`布局发生变化的生成`\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_d11748328359.webp\" width=\"1024\"\u002F>\n\u003C\u002Fp>\n\u003C\u002Fdetails>\n\n## ⚙️ ComfyUI 示例\n我们很高兴 USO 现在已原生支持 ComfyUI。要快速入门，请参阅官方教程 [USO 在 ComfyUI 中](https:\u002F\u002Fdocs.comfy.org\u002Ftutorials\u002Fflux\u002Fflux-1-uso)。为了帮助您复现并匹配结果，我们在 `.\u002Fworkflows` 中提供了多个示例，包括**工作流**及其**输入**和**输出**，以便您迅速了解 USO 的功能。随着 USO 与 ComfyUI 生态系统完全兼容，您可以将其与其他插件（如 ControlNet 和 LoRA）结合使用。**我们欢迎社区贡献更多工作流和示例。**\n\n现在您可以在 ComfyUI 中轻松运行 USO。只需将 ComfyUI 更新至最新版本 (0.3.57)，您便可在官方模板中找到 USO。\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_5c74835151de.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n以下提供更多示例：\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_46b6ed6babee.webp\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n**身份保留**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_41dde027142e.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n下载上方图片并将其拖入 ComfyUI，即可加载对应的[工作流](workflow\u002Fexample1.json)。输入图片可在 `.\u002Fworkflow` 中找到。\n\n**身份风格化**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_d38f78582d82.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n下载上方图片并将其拖入 ComfyUI，即可加载对应的[工作流](workflow\u002Fexample3.json)。输入图片可在 `.\u002Fworkflow` 中找到。\n\n**身份 + 风格参考**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_ae461c387d7c.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n下载上方图片并将其拖入 ComfyUI，即可加载对应的[工作流](workflow\u002Fexample2.json)。输入图片可在 `.\u002Fworkflow` 中找到。\n\n**单张风格参考**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_6380df71e9c0.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n下载上方图片并将其拖入 ComfyUI，即可加载对应的[工作流](workflow\u002Fexample4.json)。输入图片可在 `.\u002Fworkflow` 中找到。\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_f394b4511b04.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n下载上方图片并将其拖入 ComfyUI，即可加载对应的[工作流](workflow\u002Fexample6.json)。输入图片可在 `.\u002Fworkflow` 中找到。\n\n**多张风格参考**\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_readme_478bf4e0ca49.png\" width=1024 height=\"auto\">\n\u003C\u002Fp>\n\n下载上方图片并将其拖入 ComfyUI，即可加载对应的[工作流](workflow\u002Fexample5.json)。输入图片可在 `.\u002Fworkflow` 中找到。\n\n## 📄 免责声明\n\u003Cp>\n  我们开源此项目用于学术研究。本项目中使用的绝大多数图像要么是自动生成的，要么来自开源数据集。如果您有任何疑虑，请联系我们，我们将立即移除任何不当内容。  \n  本项目采用 Apache 2.0 许可证发布。如果您将其应用于其他基础模型，请确保遵守原始许可条款。  \n  \u003Cbr>\u003Cbr>本研究旨在推动生成式人工智能领域的发展。用户可以自由使用此工具生成图像，但需遵守当地法律法规并负责任地使用。开发者不对用户滥用该工具的行为承担任何责任。\u003C\u002Fp>\n\n## 🚀 更新\n为促进研究和开源社区的发展，我们计划将整个项目开源，涵盖训练、推理、权重、数据集等。感谢您的耐心与支持！🌟\n- [x] 发布技术报告。\n- [x] 发布 GitHub 仓库。\n- [x] 发布推理代码。\n- [x] 发布模型检查点。\n- [x] 发布 Hugging Face Space 演示。\n- 发布训练代码。\n- 发布数据集。\n\n## 引用\n如果 USO 对您有所帮助，请为该仓库点赞。\n\n如果您认为本项目对您的研究有帮助，请考虑引用我们的论文：\n```bibtex\n@article{wu2025uso,\n    title={USO: Unified Style and Subject-Driven Generation via Disentangled and Reward Learning},\n    author={Shaojin Wu and Mengqi Huang and Yufeng Cheng and Wenxu Wu and Jiahe Tian and Yiming Luo and Fei Ding and Qian He},\n    year={2025},\n    eprint={2508.18966},\n    archivePrefix={arXiv},\n    primaryClass={cs.CV},\n}\n```","# USO 快速上手指南\n\nUSO (Unified Style and Subject-Driven Generation) 是由字节跳动智能创作实验室推出的统一框架，旨在通过解耦学习和奖励学习，同时实现**风格驱动**和**主体驱动**的图像生成。它解决了传统方法中风格迁移与主体一致性难以兼顾的问题。\n\n## 1. 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux \u002F Windows \u002F macOS\n*   **Python 版本**: 3.10 - 3.12\n*   **GPU 显存**: \n    *   标准模式：建议 24GB+\n    *   低显存模式 (FP8)：约 16GB (消费级显卡可用)\n*   **CUDA**: 推荐 CUDA 12.4 (对应 PyTorch 2.4.0)\n\n## 2. 安装步骤\n\n### 2.1 创建虚拟环境\n推荐使用 `conda` 或 `venv` 创建独立环境。\n\n```bash\n# 使用 conda (推荐)\nconda create -n uso_env python=3.10 -y\nconda activate uso_env\n\n# 或者使用 venv\npython -m venv uso_env\nsource uso_env\u002Fbin\u002Factivate  # Linux\u002FMac\n# uso_env\\Scripts\\activate   # Windows\n```\n\n### 2.2 安装 PyTorch\n安装推荐的 PyTorch 版本（基于 CUDA 12.4）：\n\n```bash\npip install torch==2.4.0 torchvision==0.19.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124\n```\n> **提示**：国内用户若下载缓慢，可尝试使用清华源或阿里源替换上述命令中的 index-url，但需确保版本兼容性。\n\n### 2.3 安装项目依赖\n\n```bash\npip install -r requirements.txt\n```\n\n### 2.4 下载模型权重\n\n1.  **配置 Hugging Face Token**：\n    复制示例配置文件并填入您的 HF Token（需在 Hugging Face 官网获取）。\n    ```bash\n    cp example.env .env\n    # 编辑 .env 文件，将 HF_TOKEN=your_huggingface_token_here 替换为真实 token\n    ```\n\n2.  **执行下载脚本**：\n    ```bash\n    pip install huggingface_hub\n    python .\u002Fweights\u002Fdownloader.py\n    ```\n    > **注意**：如果您已经手动下载了权重文件，请编辑 `.\u002Fweights\u002Fdownloader.py`，注释掉不需要下载的权重部分。\n\n## 3. 基本使用\n\nUSO 支持多种生成模式，主要通过 `inference.py` 脚本运行。以下是最常用的几种场景：\n\n### 3.1 主体驱动生成 (Subject-Driven)\n保持人物\u002F物体身份一致，生成新场景。\n*   `--image_paths`: 第一张图为主体参考图。\n\n```bash\npython inference.py --prompt \"The man in flower shops carefully match bouquets, conveying beautiful emotions and blessings with flowers.\" --image_paths \"assets\u002Fgradio_examples\u002Fidentity1.jpg\" --width 1024 --height 1024\n```\n\n### 3.2 风格驱动生成 (Style-Driven)\n保持内容布局，应用新的艺术风格。\n*   `--image_paths`: 第一个参数留空 `\"\"`，后续为风格参考图。\n\n```bash\npython inference.py --prompt \"A cat sleeping on a chair.\" --image_paths \"\" \"assets\u002Fgradio_examples\u002Fstyle1.webp\" --width 1024 --height 1024\n```\n\n### 3.3 风格 + 主体联合生成 (Style-Subject Driven)\n同时将特定主体放入特定风格中。\n*   `--image_paths`: 第一张为主体，第二张为风格。\n\n```bash\npython inference.py --prompt \"The woman gave an impassioned speech on the podium.\" --image_paths \"assets\u002Fgradio_examples\u002Fidentity2.webp\" \"assets\u002Fgradio_examples\u002Fstyle2.webp\" --width 1024 --height 1024\n```\n\n### 3.4 低显存模式 (Low VRAM \u002F FP8)\n如果您的显存有限（约 16GB），请添加 `--offload` 和 `--model_type flux-dev-fp8` 参数。\n\n```bash\npython inference.py --prompt \"your prompt\" --image_paths \"your_image.jpg\" --width 1024 --height 1024 --offload --model_type flux-dev-fp8\n```\n\n### 3.5 启动本地 Web Demo\n想要可视化操作？可以启动 Gradio 界面：\n\n```bash\n# 标准模式\npython app.py\n\n# 低显存模式\nexport FLUX_DEV_FP8=\"YOUR_FLUX_DEV_PATH\"\npython app.py --offload --name flux-dev-fp8\n```\n启动后，在浏览器访问显示的本地地址（通常为 `http:\u002F\u002F127.0.0.1:7860`）即可使用。\n\n---\n**更多玩法**：USO 已原生支持 **ComfyUI**。更新 ComfyUI 至最新版 (0.3.57+) 后，可在官方模板中找到 USO 节点，或直接导入项目 `.\u002Fworkflow` 目录下的工作流文件进行高级创作。","某独立游戏开发团队需要为新品快速生成一套既保持主角形象一致、又具备多种美术风格（如赛博朋克、水墨风）的角色宣传图。\n\n### 没有 USO 时\n- **风格与主体难以兼得**：使用传统风格迁移工具时，一旦应用强烈的新画风，主角的面部特征或服饰细节就会严重失真，导致角色“换脸”。\n- **工作流割裂低效**：团队必须分别运行“主体保持”和“风格迁移”两套不同的模型，反复手动微调参数以寻找平衡点，耗时极长。\n- **批量生产质量不稳**：在尝试生成数十张不同风格的变体时，每张图的主体一致性波动巨大，后期需要人工逐张修图或重绘，无法直接商用。\n- **显存门槛高**：同时加载多个大模型进行串联推理，对消费级显卡的显存压力极大，经常导致渲染中断。\n\n### 使用 USO 后\n- **主体风格完美解耦**：USO 通过解耦学习机制，能在应用极致画风的同时，精准锁定主角的核心特征，确保“形变神不变”。\n- **统一框架一键生成**：只需在一个模型中同时输入主体参考图和风格参考图，即可直接输出高质量结果，将原本复杂的串联流程简化为单步推理。\n- **奖励机制提升质感**：内置的风格奖励学习范式自动优化画面审美，批量生成的图片均达到商用级别，大幅减少了后期人工修整成本。\n- **低显存友好部署**：得益于 fp8 模式支持，USO 在约 16GB 显存的消费级显卡上也能流畅运行，让中小团队无需昂贵算力即可落地。\n\nUSO 真正打破了风格化与主体一致性之间的对立，让创意人员能以前所未有的效率实现“千人千面”且“一人千风”的高质量内容创作。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fbytedance_USO_aa363a93.webp","bytedance","Bytedance Inc.","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fbytedance_7fee2b15.png","",null,"ByteDanceOSS","https:\u002F\u002Fopensource.bytedance.com","https:\u002F\u002Fgithub.com\u002Fbytedance",[82],{"name":83,"color":84,"percentage":85},"Python","#3572A5",100,1218,77,"2026-04-14T05:05:34","Apache-2.0","未说明","需要 NVIDIA GPU，支持 CUDA 12.4。标准模式显存需求未明确，低显存模式 (FP8) 峰值显存约 16GB-18GB。",{"notes":93,"python":94,"dependencies":95},"1. 推荐使用 conda 或 venv 创建虚拟环境。2. 需配置 Hugging Face Token 以下载模型权重。3. 消费级显卡用户可使用 --offload 和 --model_type flux-dev-fp8 参数开启低显存模式，将峰值显存降至约 16GB。4. 已原生支持 ComfyUI (需版本 0.3.57+)。","3.10 - 3.12",[96,97,98],"torch==2.4.0","torchvision==0.19.0","huggingface_hub",[15],"2026-03-27T02:49:30.150509","2026-04-16T10:47:22.935487",[103],{"id":104,"question_zh":105,"answer_zh":106,"source_url":107},35731,"USO 是否使用了 FLUX.1 Redux 的思想？为什么没有提及？","虽然 USO 和 FLUX.1-redux 都利用了 SigLIP 编码器，但两者的风格对齐方法截然不同。简单来说，USO 通过一个在特定风格相似性对上训练的自定义多特征投影器来投影风格图像（而非内容图像）。这与 Redux 不同，Redux 是将内容图像直接与文本空间对齐，我们发现这种方法在我们的特定任务中效果较差。\n\n我们的方法在概念上更接近论文中引用的其他方法（如 Kontext）。未提及 FLUX.1-redux 并非有意为之，因为我们的主要贡献在于风格对齐的整体框架、内容与风格的解耦以及 SRL。详细的分解和消融研究可以在我们的论文中找到。","https:\u002F\u002Fgithub.com\u002Fbytedance\u002FUSO\u002Fissues\u002F25",[]]