├── .github └── workflows │ └── build.yml ├── LICENSE ├── README.adoc ├── README.zh.adoc ├── build.sh ├── docs ├── cuda-toolkit-install-selection.webp ├── screenshot.webp └── select_workflow.webp ├── files-to-attach ├── ComfyUI │ └── user │ │ └── default │ │ ├── comfy.settings.json │ │ └── workflows │ │ └── sf3d_example.json ├── run.bat └── run_cn.bat └── requirements.txt /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: "Build & Upload Package" 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build_upload: 8 | permissions: 9 | contents: "write" 10 | packages: "write" 11 | pull-requests: "read" 12 | runs-on: windows-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Stage 1 Build 17 | shell: bash 18 | run: bash build.sh 19 | 20 | - name: Stage 2 Compress 21 | shell: cmd 22 | run: | 23 | "C:\Program Files\7-Zip\7z.exe" a -t7z -m0=lzma2 -mx=4 -mfb=32 -md=4m -ms=on -mf=BCJ2 SF3D.7z SF3D 24 | 25 | - name: Upload archive to release 26 | uses: xresloader/upload-to-github-release@v1 27 | env: 28 | # This is a always-on token when you run GitHub Actions 29 | # You don't need to cofigure it 30 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 31 | with: 32 | file: "SF3D.7z*" 33 | # always draft before release 34 | draft: true 35 | overwrite: true 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 木兰公共许可证, 第2版 2 | 3 | 木兰公共许可证, 第2版 4 | 5 | 2021年5月 http://license.coscl.org.cn/MulanPubL-2.0 6 | 7 | 您对“贡献”的复制、使用、修改及分发受木兰公共许可证,第2版(以下简称“本许可证”)的如下条款的约束: 8 | 9 | 0. 定义 10 | 11 | “贡献” 是指由“贡献者”许可在“本许可证”下的受版权法保护的作品,包括最初“贡献者”许可在“本许可证”下的作品及后续“贡献者”许可在“本许可证”下的“衍生作品”。 12 | 13 | “贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 14 | 15 | “法人实体” 是指提交贡献的机构及其“关联实体”。 16 | 17 | “关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的“控制”是指拥有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 18 | 19 | “衍生作品” 是指基于“贡献”创作的作品,具体包括对全部或部分“贡献”进行修改、重写、翻译、注释、组合或与之链接(包括动态链接或静态链接)而形成的作品。仅与“贡献”进行进程间通信或系统调用的作品是独立作品,不属于“衍生作品”。 20 | 21 | “对应源代码” 是指生成、安装和(对于可执行作品)运行目标代码所需的所有源文件和与之关联的接口定义文件,以及控制这些活动的脚本,但不包括编译环境、编译工具、云服务平台(如果有)。 22 | 23 | “分发” 是指通过任何媒介向他人提供“贡献”或“衍生作品”的行为,以及利用“贡献”或“衍生作品”通过网络远程给用户提供服务的行为,例如:通过利用“贡献”或“衍生作品”搭建的云服务平台提供在线服务的行为。 24 | 25 | 1. 授予版权许可 26 | 27 | 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、“分发”其“贡献”或“衍生作品”,不论修改与否。 28 | 29 | 2. 授予专利许可 30 | 31 | 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销的情形除外)专利许可,供您使用、制造、委托制造、销售、许诺销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”中的专利权利要求,而不包括仅因您对“贡献”的修改而将必然会侵犯到的专利权利要求。如果您或您的“关联实体”直接或间接地,就“贡献”对任何人发起专利侵权诉讼(包括在诉讼中提出反诉请求或交叉请求)或发起其他专利维权行动,则“贡献者”根据“本许可证”授予您的专利许可自您发起专利诉讼或专利维权行动之日终止。 32 | 33 | 3. 无商标许可 34 | 35 | “贡献者”在“本许可证”下不提供对其商品名称、商标、服务标识或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用的情形除外。 36 | 37 | 4. 分发限制 38 | 39 | 您可以将您接收到的“贡献”或您的“衍生作品”以源程序形式或可执行形式重新“分发”,但必须满足下列条件: 40 | 41 | (1)您必须向接收者提供“本许可证”的副本,并保留“贡献”中的版权、商标、专利及免责声明;并且, 42 | 43 | (2)如果您“分发”您接收到的“贡献”,您必须使用“本许可证”提供该“贡献”的源代码副本;如果您 “分发”您的“衍生作品”,您必须: 44 | 45 | (i)随“衍生作品”提供使用“本许可证”“分发”的您的“衍生作品”的“对应源代码”。如果您通过下载链接提供前述“对应源代码”,则您应将下载链接地址置于“衍生作品”或其随附文档中的明显位置,有效期自该“衍生作品”“分发”之日起不少于三年,并确保接收者可以获得“对应源代码”;或者, 46 | 47 | (ii)随“衍生作品”向接收者提供一个书面要约,表明您愿意提供根据“本许可证”“分发”的您“衍生作品”的“对应源代码”。该书面要约应置于“衍生作品”中的明显位置,并确保接收者根据书面要约可获取“对应源代码”的时间从您接到该请求之日起不得超过三个月,且有效期自该“衍生作品”“分发”之日起不少于三年。 48 | 49 | 5. 违约与终止 50 | 51 | 如果您违反“本许可证”,任何“贡献者”有权书面通知您终止其根据“本许可证”授予您的许可。该“贡献者”授予您的许可自您接到其终止通知之日起终止。仅在如下两种情形下,即使您收到“贡献者”的通知也并不终止其授予您的许可: 52 | 53 | (1)您在接到该终止通知之前已停止所有违反行为; 54 | 55 | (2)您是首次收到该“贡献者”根据“本许可证”发出的书面终止通知,并且您在收到该通知后30天内已停止所有违反行为。 56 | 57 | 只要您下游的接收者遵守“本许可证”的相关规定,即使您在“本许可证”下被授予的许可终止,不影响下游的接收者根据“本许可证”享有的权利。 58 | 59 | 6. 例外 60 | 61 | 如果您将“贡献”与采用GNU AFFERO GENERAL PUBLIC LICENSE Version 3(以下简称“AGPLv3”)或其后续版本的作品结合形成新的“衍生作品”,且根据“AGPLv3”或其后续版本的要求您有义务将新形成的“衍生作品”以“AGPLv3”或其后续版本进行许可的,您可以根据“AGPLv3”或其后续版本进行许可,只要您在“分发”该“衍生作品”的同时向接收者提供“本许可证”的副本,并保留“贡献”中的版权、商标、专利及免责声明。但任何“贡献者”不会因您选择“AGPLv3”或其后续版本而授予该“衍生作品”的接收者更多权利。 62 | 63 | 7. 免责声明与责任限制 64 | 65 | “贡献”在提供时不带有任何明示或默示的担保。在任何情况下,“贡献者”或版权人不对任何人因使用“贡献”而引发的任何直接或间接损失承担任何责任,不论该等损失因何种原因导致或者基于何种法律理论,即使其曾被告知有该等损失的可能性。 66 | 67 | 8. 语言 68 | 69 | “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何不一致,以中文版为准。 70 | 71 | 条款结束 72 | 73 | 如何将木兰公共许可证,第2版,应用到您的软件 74 | 75 | 如果您希望将木兰公共许可证,第2版,应用到您的软件,为了方便接收者查阅,建议您完成如下三步: 76 | 77 | 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; 78 | 79 | 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; 80 | 81 | 3, 请将如下声明文本放入每个源文件的头部注释中。 82 | 83 | Copyright (c) [Year] [name of copyright holder] 84 | [Software Name] is licensed under Mulan PubL v2. 85 | You can use this software according to the terms and conditions of the Mulan PubL v2. 86 | You may obtain a copy of Mulan PubL v2 at: 87 | http://license.coscl.org.cn/MulanPubL-2.0 88 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 89 | EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 90 | MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 91 | See the Mulan PubL v2 for more details. 92 | 93 | 94 | Mulan Public License,Version 2 95 | 96 | Mulan Public License,Version 2 (Mulan PubL v2) 97 | 98 | May 2021 http://license.coscl.org.cn/MulanPubL-2.0 99 | 100 | Your reproduction, use, modification and Distribution of the Contribution shall be subject to Mulan Public License, Version 2 (this License) with following terms and conditions: 101 | 102 | 0. Definition 103 | 104 | Contribution means the copyrightable work licensed by a particular Contributor under this License, including the work licensed by the initial Contributor under this License and its Derivative Work licensed by any subsequent Contributor under this License. 105 | 106 | Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. 107 | 108 | Legal Entity means the entity making a Contribution and all its Affiliates. 109 | 110 | Affiliates mmeans entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. 111 | 112 | Derivative Work means works created based on Contribution, specifically including works formed by modifying, rewriting, translating, annotating, combining or linking to all or part of Contribution (including dynamic linking or static linking). Works which only communicate with Contribution through inter-process communication or system call, are independent works, rather than Derivative Work. 113 | 114 | Corresponding Source Code means all the source code needed to generate, install, and (for an executable work) run the object code including the interface definition files associated with source files for the work, and scripts to control those activities, excluding of compilation environment and compilation tools, cloud services platform (if any). 115 | 116 | Distribute (or Distribution) means the act of making the Contribution or Derivative Work available to others through any medium, and using the Contribution or Derivative Work to provide online services to users, such as the act of providing online services through a cloud service platform built using Contributions or Derivative Works. 117 | 118 | 1. Grant of Copyright License 119 | 120 | Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or Distribute its Contribution or Derivative Work, with modification or not. 121 | 122 | 2. Grant of Patent License 123 | 124 | Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to use, make, have made, sell, offer for sale, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, excluding of any patent claims solely be infringed by your modification. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that any Contribution infringes patents, then any patent license granted to you under this License for the Contribution shall terminate as of the date such litigation or activity is filed or taken. 125 | 126 | 3. No Trademark License 127 | 128 | No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. 129 | 130 | 4. Distribution Restriction 131 | 132 | You may Distribute the Contribution you received or your Derivative Work, whether in source or executable forms, provided that you meet the following conditions: 133 | 134 | 1) You must provide recipients with a copy of this License and retain copyright, trademark, patent and disclaimer statements in the Contribution; and, 135 | 136 | 2) If you Distribute the Contribution you received, you must provide copies of the Contribution’s source code under this License; 137 | 138 | If you Distribute your Derivative Work, you have to: 139 | 140 | (i) accompanying the Derivative work, provide recipients with Corresponding Source Code of your Derivative Work under this License. If you provide the Corresponding Source Code through a download link, you should place such link address prominently in the Derivative Work or its accompanying documents, and be valid no less than three years from your Distribution of the particular Derivative Work, and ensure that the recipients can acquire the Corresponding Source Code through the link; or, 141 | 142 | (ii) accompanying the Derivative Work, provide recipients with a written offer indicating your willingness to provide the Corresponding Source Code of the Derivative Work licensed under this License. Such written offer shall be placed prominently in the Derivative Work or its accompanying documents. Without reasonable excuse, the recipient shall be able to acquire the Corresponding Source code of the Derivative work for no more than three months from your receipt of a valid request, and be valid no less than three years from your Distribution of the particular Derivative Work. 143 | 144 | 5. Breach and Termination 145 | 146 | If you breach this License, any Contributor has the right to notify you in writing to terminate its license granted to you under this License. The license granted to you by such Contributor terminates upon your receipt of such notice of termination. Notwithstanding the foregoing, your license will not be terminated even if you receive a notice of termination from Contributor, provided that: 147 | 148 | 1) you have cured all the breaches prior to receiving such notice of termination; or, 149 | 150 | 2) it’s your first time to receive a notice of termination from such Contributor pursuant to this License, and you have cured all the breaches within 30 days of receipt of such notice. 151 | 152 | Termination of your license under this License shall not affect the downstream recipient's rights under this License, provided that the downstream recipient complies with this License. 153 | 154 | 6. Exceptions 155 | 156 | If you combine Contribution or your Derivative Work with a work licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 (hereinafter referred to as “AGPLv3”) or its subsequent versions, and according to the AGPLv3 or its subsequent versions, you have an obligation to make the combined work to be licensed under the corresponding license, you can license such combined work under the license, provided that when you Distribute the combined work, you also provide a copy of this License to the recipients, and retain copyright, trademarks, patents, and disclaimer statements in the Contribution. No Contributor will grant additional rights to the recipients of the combined work for your license under AGPLv3 or its subsequent versions. 157 | 158 | 7. Disclaimer of Warranty and Limitation of liability 159 | 160 | CONTRIBUTION ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE CONTRIBUTION, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 161 | 162 | 8. Language 163 | 164 | THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. 165 | 166 | END OF THE TERMS AND CONDITIONS 167 | 168 | How to apply the Mulan Public License,Version 2 (Mulan PubL v2), to your software 169 | 170 | To apply the Mulan Public License,Version 2 to your work, for easy identification by recipients, you are suggested to complete following three steps: 171 | 172 | Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; 173 | Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; 174 | Attach the statement to the appropriate annotated syntax at the beginning of each source file. 175 | Copyright (c) [Year] [name of copyright holder] 176 | [Software Name] is licensed under Mulan PubL v2. 177 | You can use this software according to the terms and conditions of the Mulan PubL v2. 178 | You may obtain a copy of Mulan PubL v2 at: 179 | http://license.coscl.org.cn/MulanPubL-2.0 180 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 181 | EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 182 | MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 183 | See the Mulan PubL v2 for more details. 184 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | # StableFast3D Windows Portable 2 | 3 | image::docs/screenshot.webp["Screenshot"] 4 | 5 | *link:README.zh.adoc[中文说明]* 6 | 7 | A dedicated package for running 8 | https://github.com/Stability-AI/stable-fast-3d[Stable Fast 3D] 9 | official ComfyUI workflow on Windows. 10 | 11 | Update: This repo has been merged into 12 | https://github.com/YanWenKun/Comfy3D-WinPortable/releases/tag/r6-pt25[Comfy3D-WinPortable], 13 | a more comprehensive package. 14 | However, StableFast3D-WinPortable is more concise and still works. 15 | 16 | ## How to use 17 | 18 | 1. You need an NVIDIA GPU with at least 8GB VRAM. 19 | 20 | 2. Install Visual Studio Build Tools 2022 21 | ( 22 | https://visualstudio.microsoft.com/downloads/?q=build+tools[Page] 23 | | 24 | https://aka.ms/vs/17/release/vs_BuildTools.exe[EXE] 25 | ). 26 | During the setup, select "Desktop development with C++" workload. 27 | You only need these two optional components: 28 | 29 | ** MSVC Build Tools (compilers and libraries) 30 | ** CMake for C++ on Windows 31 | ** If you already installed Visual Studio with C++ workload, just skip this step. (Some PyTorch extension code needs to be compiled during runtime, so the build tools are needed.) 32 | 33 | 3. Install 34 | https://developer.nvidia.com/cuda-12-4-1-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_network[CUDA Toolkit] 35 | with version no later than 12.4.1. 36 | You only need to install 37 | https://github.com/YanWenKun/StableFast3D-WinPortable/raw/refs/heads/main/docs/cuda-toolkit-install-selection.webp[Libraries and Compilers]. 38 | 39 | 4. On Hugging Face: 40 | 41 | ** Register/Login 42 | https://huggingface.co/login[Hugging Face]. 43 | 44 | ** Go to 45 | https://huggingface.co/stabilityai/stable-fast-3d[Stable Fast 3D repository], 46 | fill in and agree Stability AI's License Agreement. 47 | 48 | ** Go to 49 | https://huggingface.co/settings/tokens/new?tokenType=read[Access Tokens], 50 | create a read-only token. 51 | 52 | 5. In the 53 | https://github.com/YanWenKun/StableFast3D-WinPortable/releases[StableFast3D-WinPortable/releases] page, 54 | download `SF3D.7z`, extract it to a convenient place. 55 | 56 | 6. Edit `run.bat`, find & replace `hf_your_token` 57 | with the read-only access token you just created in step 4. 58 | 59 | 7. (Optional) If you already have these model files cached in 60 | `%USERPROFILE%\.cache\huggingface\hub`, copy/move them to the `SF3D\HuggingFaceHub` folder. 61 | 62 | ** `CLIP-ViT-B-32-laion2B-s34B-b79K` 63 | ** `dinov2-large` 64 | ** `stable-fast-3d` 65 | 66 | 8. Run `run.bat`. 67 | ** When start complete, it will auto open http://localhost:8188/ in browser. 68 | 69 | 9. In the left side bar, find the workflow, open it, and click "**Queue**" button in the bottom-center of the page. 70 | 71 | image::docs/select_workflow.webp["Select Workflow"] 72 | 73 | ## File Location 74 | 75 | The output files will be saved in `ComfyUI\output`. 76 | 77 | The input files (examples) are in `ComfyUI\input`. 78 | -------------------------------------------------------------------------------- /README.zh.adoc: -------------------------------------------------------------------------------- 1 | # StableFast3D Windows Portable 2 | 3 | image::docs/screenshot.webp["Screenshot"] 4 | 5 | 一个专门用来在 Windows 下运行 6 | https://github.com/Stability-AI/stable-fast-3d[Stable Fast 3D] 7 | 官方 ComfyUI 工作流的整合包。 8 | 9 | 更新:本项目已与 10 | https://github.com/YanWenKun/Comfy3D-WinPortable/releases/tag/r6-pt25[Comfy3D-WinPortable] 11 | 合并,后者有着更全面的功能。 12 | 本项目依然可以正常运行。 13 | 14 | ## 使用步骤 15 | 16 | 1. 需要 NVIDIA GPU,至少 8GB 显存。 17 | 18 | 2. 安装 Visual Studio Build Tools 2022 19 | ( 20 | https://visualstudio.microsoft.com/downloads/?q=build+tools[下载页面] 21 | | 22 | https://aka.ms/vs/17/release/vs_BuildTools.exe[安装程序] 23 | ), 24 | 选择安装“桌面C++开发”,仅需要这两个可选项: 25 | 26 | ** MSVC 生成工具(最新即可) 27 | ** 用于 Windows 的 C++ CMake 工具 28 | ** 3D 工作流需要 JIT 编译 PyTorch C++ 扩展,所以需要编译工具。如果你已经安装了 Visual Studio C++ 工作负载,不必重复安装。 29 | 30 | 3. 安装 31 | https://developer.nvidia.com/cuda-12-4-1-download-archive?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_network[CUDA Toolkit], 32 | 版本不新于 12.4.1,再高会有兼容性问题。 33 | 安装时只需要勾选 34 | https://github.com/YanWenKun/StableFast3D-WinPortable/raw/refs/heads/main/docs/cuda-toolkit-install-selection.webp[Libraries 以及 Compilers] 35 | 。 36 | 37 | 4. Hugging Face 相关: 38 | 39 | ** 注册/登录 40 | https://huggingface.co/login[Hugging Face]。 41 | 42 | ** 打开 43 | https://huggingface.co/stabilityai/stable-fast-3d[Stable Fast 3D 仓库页面], 44 | 填写表格,并同意 Stability AI 的协议。 45 | 46 | ** 打开 47 | https://huggingface.co/settings/tokens/new?tokenType=read[Access Tokens 页面], 48 | 创建一个只读 token。 49 | 50 | 5. 在 51 | https://github.com/YanWenKun/StableFast3D-WinPortable/releases[StableFast3D-WinPortable/releases] 52 | 页面, 53 | 下载 `SF3D.7z`,解压到一个方便的地方。 54 | 55 | 6. 编辑 `run_cn.bat`,查找 `hf_your_token` 并替换为步骤4中创建的只读 token。 56 | 57 | 7. (可选)如果你已有下列模型文件保存在 `%USERPROFILE%\.cache\huggingface\hub`, 58 | 可将它们复制/移动到 `SF3D\HuggingFaceHub` 文件夹。 59 | 60 | ** `CLIP-ViT-B-32-laion2B-s34B-b79K` 61 | ** `dinov2-large` 62 | ** `stable-fast-3d` 63 | 64 | 8. 运行 `run_cn.bat`。 65 | ** 启动完毕后,会自动打开浏览器并访问 http://localhost:8188/ 66 | 67 | 9. 在左侧边栏中,找到工作流(快捷键 w),点击打开工作流,再点击页面正下方的 **Queue** 开始执行工作流。 68 | 69 | image::docs/select_workflow.webp["Select Workflow"] 70 | 71 | ## 文件位置 72 | 73 | 生成的 3D `.glb` 文件会保存在 `ComfyUI\output` 下。 74 | 75 | 输入图片在 `ComfyUI\input` 文件夹下。 76 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eux 3 | 4 | git config --global core.autocrlf true 5 | gcs='git clone --depth=1 --no-tags --recurse-submodules --shallow-submodules' 6 | workdir=$(pwd) 7 | pip_exe="${workdir}/python_standalone/python.exe -s -m pip" 8 | export PYTHONPYCACHEPREFIX="$workdir"/pycache 9 | export PATH="$PATH:$workdir/python_standalone/Scripts" 10 | export PIP_NO_WARN_SCRIPT_LOCATION=0 11 | 12 | # Replace URL if you need to use PIP mirror site 13 | # 使用国内源下载,替换为 https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple 14 | export PIP_INDEX_URL="https://pypi.org/simple" 15 | 16 | ls -lahF 17 | 18 | # Download Python Standalone 19 | cd "$workdir" 20 | curl -sSL \ 21 | https://github.com/astral-sh/python-build-standalone/releases/download/20250212/cpython-3.12.9+20250212-x86_64-pc-windows-msvc-shared-install_only.tar.gz \ 22 | -o python.tar.gz 23 | tar -zxf python.tar.gz 24 | mv python python_standalone 25 | 26 | # PIP installs 27 | $pip_exe install \ 28 | --upgrade pip wheel setuptools 29 | 30 | $pip_exe install \ 31 | xformers==0.0.29.post3 torch==2.6.0 torchvision torchaudio \ 32 | --index-url https://download.pytorch.org/whl/cu126 \ 33 | --extra-index-url $PIP_INDEX_URL 34 | 35 | $pip_exe install -r https://github.com/comfyanonymous/ComfyUI/raw/refs/heads/master/requirements.txt 36 | 37 | $pip_exe install \ 38 | https://github.com/YanWenKun/Comfy3D-WinPortable/releases/download/r7-wheels/texture_baker-0.0.1-cp312-cp312-win_amd64.whl \ 39 | https://github.com/YanWenKun/Comfy3D-WinPortable/releases/download/r7-wheels/uv_unwrapper-0.0.1-cp312-cp312-win_amd64.whl 40 | 41 | $pip_exe install -r "$workdir"/requirements.txt 42 | 43 | $pip_exe list 44 | 45 | # Done installing dependencies 46 | # Downloading repos 47 | 48 | cd "$workdir" 49 | 50 | mkdir SF3D 51 | 52 | mv python_standalone SF3D/ 53 | 54 | cd SF3D 55 | 56 | mkdir HuggingFaceHub 57 | 58 | git clone https://github.com/comfyanonymous/ComfyUI.git 59 | cd ComfyUI 60 | git reset --hard "$(git tag | grep -e '^v' | sort -V | tail -1)" 61 | 62 | cd custom_nodes 63 | $gcs https://github.com/Stability-AI/stable-fast-3d.git 64 | 65 | cp stable-fast-3d/demo_files/examples/* ../input/ 66 | 67 | cd "$workdir" 68 | 69 | cp -rf "$workdir"/files-to-attach/* \ 70 | "$workdir"/SF3D/ 71 | 72 | du -hd1 73 | -------------------------------------------------------------------------------- /docs/cuda-toolkit-install-selection.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YanWenKun/StableFast3D-WinPortable/8bf296e2fa816cfdfa6a8de449c0b6a6d2d7769c/docs/cuda-toolkit-install-selection.webp -------------------------------------------------------------------------------- /docs/screenshot.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YanWenKun/StableFast3D-WinPortable/8bf296e2fa816cfdfa6a8de449c0b6a6d2d7769c/docs/screenshot.webp -------------------------------------------------------------------------------- /docs/select_workflow.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YanWenKun/StableFast3D-WinPortable/8bf296e2fa816cfdfa6a8de449c0b6a6d2d7769c/docs/select_workflow.webp -------------------------------------------------------------------------------- /files-to-attach/ComfyUI/user/default/comfy.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comfy.UseNewMenu": "Top" 3 | } -------------------------------------------------------------------------------- /files-to-attach/ComfyUI/user/default/workflows/sf3d_example.json: -------------------------------------------------------------------------------- 1 | { 2 | "last_node_id": 10, 3 | "last_link_id": 12, 4 | "nodes": [ 5 | { 6 | "id": 8, 7 | "type": "StableFast3DSampler", 8 | "pos": [ 9 | 756.9950672198843, 10 | 9.735666739723854 11 | ], 12 | "size": { 13 | "0": 315, 14 | "1": 166 15 | }, 16 | "flags": {}, 17 | "order": 3, 18 | "mode": 0, 19 | "inputs": [ 20 | { 21 | "name": "model", 22 | "type": "SF3D_MODEL", 23 | "link": 8 24 | }, 25 | { 26 | "name": "image", 27 | "type": "IMAGE", 28 | "link": 10, 29 | "slot_index": 1 30 | }, 31 | { 32 | "name": "mask", 33 | "type": "MASK", 34 | "link": 11 35 | }, 36 | { 37 | "name": "remesh", 38 | "type": "none", 39 | "link": null, 40 | "slot_index": 3 41 | } 42 | ], 43 | "outputs": [ 44 | { 45 | "name": "mesh", 46 | "type": "MESH", 47 | "links": [ 48 | 9 49 | ], 50 | "shape": 3, 51 | "slot_index": 0 52 | } 53 | ], 54 | "properties": { 55 | "Node name for S&R": "StableFast3DSampler" 56 | }, 57 | "widgets_values": [ 58 | 0.85, 59 | 1024, 60 | "triangle" 61 | ] 62 | }, 63 | { 64 | "id": 9, 65 | "type": "StableFast3DSave", 66 | "pos": [ 67 | 1116, 68 | 8 69 | ], 70 | "size": [ 71 | 600, 72 | 512 73 | ], 74 | "flags": {}, 75 | "order": 4, 76 | "mode": 0, 77 | "inputs": [ 78 | { 79 | "name": "mesh", 80 | "type": "MESH", 81 | "link": 9 82 | } 83 | ], 84 | "properties": { 85 | "Node name for S&R": "StableFast3DSave" 86 | }, 87 | "widgets_values": [ 88 | "SF3D", 89 | null 90 | ] 91 | }, 92 | { 93 | "id": 6, 94 | "type": "InvertMask", 95 | "pos": [ 96 | 485, 97 | 132 98 | ], 99 | "size": { 100 | "0": 210, 101 | "1": 26 102 | }, 103 | "flags": {}, 104 | "order": 2, 105 | "mode": 0, 106 | "inputs": [ 107 | { 108 | "name": "mask", 109 | "type": "MASK", 110 | "link": 6 111 | } 112 | ], 113 | "outputs": [ 114 | { 115 | "name": "MASK", 116 | "type": "MASK", 117 | "links": [ 118 | 11 119 | ], 120 | "shape": 3, 121 | "slot_index": 0 122 | } 123 | ], 124 | "properties": { 125 | "Node name for S&R": "InvertMask" 126 | } 127 | }, 128 | { 129 | "id": 1, 130 | "type": "LoadImage", 131 | "pos": [ 132 | 105, 133 | 26 134 | ], 135 | "size": { 136 | "0": 315, 137 | "1": 314 138 | }, 139 | "flags": {}, 140 | "order": 0, 141 | "mode": 0, 142 | "outputs": [ 143 | { 144 | "name": "IMAGE", 145 | "type": "IMAGE", 146 | "links": [ 147 | 10 148 | ], 149 | "shape": 3, 150 | "slot_index": 0 151 | }, 152 | { 153 | "name": "MASK", 154 | "type": "MASK", 155 | "links": [ 156 | 6 157 | ], 158 | "shape": 3, 159 | "slot_index": 1 160 | } 161 | ], 162 | "properties": { 163 | "Node name for S&R": "LoadImage" 164 | }, 165 | "widgets_values": [ 166 | "axe.png", 167 | "image" 168 | ] 169 | }, 170 | { 171 | "id": 7, 172 | "type": "StableFast3DLoader", 173 | "pos": [ 174 | 478, 175 | -27 176 | ], 177 | "size": { 178 | "0": 210, 179 | "1": 26 180 | }, 181 | "flags": {}, 182 | "order": 1, 183 | "mode": 0, 184 | "outputs": [ 185 | { 186 | "name": "sf3d_model", 187 | "type": "SF3D_MODEL", 188 | "links": [ 189 | 8 190 | ], 191 | "shape": 3, 192 | "slot_index": 0 193 | } 194 | ], 195 | "properties": { 196 | "Node name for S&R": "StableFast3DLoader" 197 | } 198 | } 199 | ], 200 | "links": [ 201 | [ 202 | 6, 203 | 1, 204 | 1, 205 | 6, 206 | 0, 207 | "MASK" 208 | ], 209 | [ 210 | 8, 211 | 7, 212 | 0, 213 | 8, 214 | 0, 215 | "SF3D_MODEL" 216 | ], 217 | [ 218 | 9, 219 | 8, 220 | 0, 221 | 9, 222 | 0, 223 | "MESH" 224 | ], 225 | [ 226 | 10, 227 | 1, 228 | 0, 229 | 8, 230 | 1, 231 | "IMAGE" 232 | ], 233 | [ 234 | 11, 235 | 6, 236 | 0, 237 | 8, 238 | 2, 239 | "MASK" 240 | ] 241 | ], 242 | "groups": [], 243 | "config": {}, 244 | "extra": { 245 | "ds": { 246 | "scale": 0.6209213230591552, 247 | "offset": [ 248 | 80.89139921077967, 249 | 610.3296066172098 250 | ] 251 | } 252 | }, 253 | "version": 0.4 254 | } 255 | -------------------------------------------------------------------------------- /files-to-attach/run.bat: -------------------------------------------------------------------------------- 1 | @REM Replace hf_your_token with your HuggingFace Access Token. 2 | @REM https://huggingface.co/settings/tokens/new?tokenType=read 3 | set HF_TOKEN=hf_your_token 4 | 5 | @REM This command redirects HuggingFace-Hub to download model files in this folder. 6 | set HF_HUB_CACHE=%~dp0\HuggingFaceHub 7 | 8 | @REM This command let the .pyc cache files to be saved together in this folder. 9 | set PYTHONPYCACHEPREFIX=%~dp0\pycache 10 | 11 | @REM If you don't want the browser to open automatically, add " --disable-auto-launch" (without quotation marks) to the end of the line below. 12 | .\python_standalone\python.exe -s ComfyUI\main.py --windows-standalone-build 13 | 14 | pause 15 | -------------------------------------------------------------------------------- /files-to-attach/run_cn.bat: -------------------------------------------------------------------------------- 1 | @REM 把 hf_your_token 替换为你的 HuggingFace Access Token。 2 | @REM https://huggingface.co/settings/tokens/new?tokenType=read 3 | set HF_TOKEN=hf_your_token 4 | 5 | @REM 使用国内的 HuggingFace 镜像。 6 | set HF_ENDPOINT=https://hf-mirror.com 7 | 8 | @REM 使用国内的 PIP 镜像(应该用不上,仅防万一)。 9 | set PIP_INDEX_URL=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple 10 | 11 | @REM 让 HuggingFace-Hub 下载模型到本目录,而不是"用户/.cache"目录。 12 | set HF_HUB_CACHE=%~dp0\HuggingFaceHub 13 | 14 | @REM 该行命令会使 .pyc 缓存文件集中保存在一处。 15 | set PYTHONPYCACHEPREFIX=%~dp0\pycache 16 | 17 | @REM 如果不想要 ComfyUI 启动后自动打开浏览器,添加" --disable-auto-launch"(不含引号)到下行末尾。 18 | .\python_standalone\python.exe -s ComfyUI\main.py --windows-standalone-build 19 | 20 | pause 21 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | huggingface_hub 2 | 3 | einops==0.8.0 4 | jaxtyping==0.2.36 5 | omegaconf==2.3.0 6 | transformers==4.48.1 7 | open_clip_torch==2.30.0 8 | trimesh==4.6.0 9 | numpy==1.26.4 10 | 11 | rembg[gpu]==2.0.61 12 | rembg==2.0.61 13 | 14 | gpytoolbox==0.3.3 15 | pynanoinstantmeshes==0.0.3 16 | --------------------------------------------------------------------------------