{"id":216,"date":"2026-01-22T09:44:28","date_gmt":"2026-01-22T01:44:28","guid":{"rendered":"https:\/\/www.starverse-ai.com\/guide\/?p=216"},"modified":"2026-01-22T09:45:41","modified_gmt":"2026-01-22T01:45:41","slug":"unipic-2%e6%9c%ac%e5%9c%b0%e9%83%a8%e7%bd%b2%e6%95%99%e7%a8%8b%e7%ae%80%e7%ba%a6%e7%89%88","status":"publish","type":"post","link":"https:\/\/www.starverse-ai.com\/guide\/archives\/216","title":{"rendered":"UniPic-2\u672c\u5730\u90e8\u7f72\u6559\u7a0b(\u7b80\u7ea6\u7248)"},"content":{"rendered":"\n<p>UniPic-2\u5728ai\u56fe\u50cf\u5904\u7406\u6280\u672f\u83b7\u5f97\u7a81\u7834\u589e\u957f,\u62e5\u6709\u66f4\u5f3a\u7684\u98ce\u683c\u53d8\u6362\u529f\u80fd,\u5927\u5bb6\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u6559\u7a0b\u672c\u5730\u90e8\u7f72\u6d4b\u8bd5\u6548\u679c\uff01<\/p>\n\n\n\n<p>\u4e00\u3001UniPic-2 \u7b80\u4ecb<\/p>\n\n\n\n<p>UniPic-2 \u662f\u4e00\u6b3e\u652f\u6301\u672c\u5730\u8fd0\u884c\u7684\u591a\u529f\u80fd\u56fe\u50cf\u5904\u7406\/\u751f\u6210\u6a21\u578b(\u5982\u56fe\u50cf\u589e\u5f3a\u3001\u4fee\u590d\u3001\u98ce\u683c\u8f6c\u6362\u7b49)\u3002\u76f8\u6bd4\u4e91\u7aef\u670d\u52a1\uff0c\u672c\u5730\u90e8\u7f72\u5177\u6709\u9690\u79c1\u6027\u5f3a\u3001\u53ef\u79bb\u7ebf\u4f7f\u7528\u3001\u53ef\u6df1\u5ea6\u5b9a\u5236\u3001\u957f\u671f\u6210\u672c\u4f4e\u7b49\u4f18\u52bf\uff0c\u9002\u5408\u5f00\u53d1\u8005\u3001\u81ea\u5a92\u4f53\u521b\u4f5c\u8005\u4ee5\u53ca\u5bf9\u6570\u636e\u5b89\u5168\u8981\u6c42\u8f83\u9ad8\u7684\u7528\u6237\u3002<\/p>\n\n\n\n<p>\u4e8c\u3001\u90e8\u7f72\u524d\u7684\u51c6\u5907\u5de5\u4f5c<\/p>\n\n\n\n<p>1. \u786c\u4ef6\u8981\u6c42<\/p>\n\n\n\n<p>CPU\uff1a\u63a8\u8350 8 \u6838\u53ca\u4ee5\u4e0a(\u6700\u4f4e\u53ef\u7528 4 \u6838)<\/p>\n\n\n\n<p>\u5185\u5b58\uff1a\u81f3\u5c11 16GB(\u63a8\u8350 32GB)<\/p>\n\n\n\n<p>GPU\uff08\u5f3a\u70c8\u63a8\u8350\uff09\uff1a<\/p>\n\n\n\n<p>NVIDIA \u663e\u5361\uff0c\u663e\u5b58 \u2265 8GB(12GB \u6216\u4ee5\u4e0a\u4f53\u9a8c\u66f4\u4f73)<\/p>\n\n\n\n<p>\u652f\u6301 CUDA<\/p>\n\n\n\n<p>\u786c\u76d8\u7a7a\u95f4\uff1a\u9884\u7559 20GB \u4ee5\u4e0a<\/p>\n\n\n\n<p>\u6ca1\u6709 GPU \u4e5f\u53ef\u4ee5\u8fd0\u884c\uff0c\u4f46\u901f\u5ea6\u4f1a\u660e\u663e\u53d8\u6162\u3002<\/p>\n\n\n\n<p>2. \u64cd\u4f5c\u7cfb\u7edf<\/p>\n\n\n\n<p>Windows 10 \/ 11(\u6700\u5e38\u89c1)<\/p>\n\n\n\n<p>Ubuntu 20.04 \/ 22.04<\/p>\n\n\n\n<p>macOS(M \u7cfb\u5217\u9700\u989d\u5916\u9002\u914d\uff0c\u5efa\u8bae\u8fdb\u9636\u7528\u6237)<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"613\" height=\"383\" src=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/UniPic-2-\u56fe\u50cf\u5904\u7406.jpg\" alt=\"UniPic-2\" class=\"wp-image-218\" srcset=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/UniPic-2-\u56fe\u50cf\u5904\u7406.jpg 613w, https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/UniPic-2-\u56fe\u50cf\u5904\u7406-300x187.jpg 300w\" sizes=\"auto, (max-width: 613px) 100vw, 613px\" \/><\/figure>\n<\/div>\n\n\n<p>3. \u8f6f\u4ef6\u73af\u5883<\/p>\n\n\n\n<p>Python 3.9 \u2013 3.11<\/p>\n\n\n\n<p>Git<\/p>\n\n\n\n<p>CUDA + cuDNN(\u4ec5 NVIDIA \u663e\u5361\u7528\u6237)<\/p>\n\n\n\n<p><strong>\u661f\u5b87\u667a\u7b97\u5b98\u7f51\u652f\u6301\u514d\u8d39\u90e8\u7f72\u7acb\u9a6c\u5b89\u88c5\uff01\u70b9\u51fb\u4e0b\u65b9\u7acb\u5373\u8bd5\u7528!<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.starverse-ai.com\/applications\/details\/tama-W1ENfG2WRPWAwvWH\"><img loading=\"lazy\" decoding=\"async\" width=\"209\" height=\"49\" src=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/QQ\u622a\u56fe20260121094818-1.jpg\" alt=\"\" class=\"wp-image-126\"\/><\/a><\/figure>\n<\/div>\n\n\n<p>\u4e09\u3001\u73af\u5883\u642d\u5efa\u6b65\u9aa4<\/p>\n\n\n\n<p>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5 Python<\/p>\n\n\n\n<p>\u524d\u5f80 Python \u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305<\/p>\n\n\n\n<p>\u5b89\u88c5\u65f6\u52fe\u9009 Add Python to PATH<\/p>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u5728\u7ec8\u7aef\u9a8c\u8bc1\uff1a<\/p>\n\n\n\n<p>python &#8211;version<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u6b65\uff1a\u5b89\u88c5 Git<\/p>\n\n\n\n<p>\u7528\u4e8e\u4e0b\u8f7d UniPic-2 \u9879\u76ee\u6e90\u7801\u3002\u5b89\u88c5\u5b8c\u6210\u540e\u6267\u884c\uff1a<\/p>\n\n\n\n<p>git &#8211;version<\/p>\n\n\n\n<p>\u56db\u3001\u4e0b\u8f7d UniPic-2 \u9879\u76ee<\/p>\n\n\n\n<p>\u5728\u4f60\u5e0c\u671b\u5b58\u653e\u9879\u76ee\u7684\u76ee\u5f55\u4e2d\u6267\u884c\uff1a<\/p>\n\n\n\n<p>git clone https:\/\/github.com\/xxx\/UniPic-2.git cd UniPic-2<\/p>\n\n\n\n<p>(\u793a\u4f8b\u5730\u5740\uff0c\u5b9e\u9645\u4ee5\u5b98\u65b9\u4ed3\u5e93\u4e3a\u51c6)<\/p>\n\n\n\n<p>\u4e94\u3001\u521b\u5efa\u865a\u62df\u73af\u5883(\u5f3a\u70c8\u63a8\u8350)<\/p>\n\n\n\n<p>python -m venv unipic_env<\/p>\n\n\n\n<p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff1a<\/p>\n\n\n\n<p>Windows<\/p>\n\n\n\n<p>unipic_env\\Scripts\\activate<\/p>\n\n\n\n<p>macOS \/ Linux<\/p>\n\n\n\n<p>source unipic_env\/bin\/activate<\/p>\n\n\n\n<p>\u6fc0\u6d3b\u6210\u529f\u540e\uff0c\u7ec8\u7aef\u524d\u4f1a\u663e\u793a\u865a\u62df\u73af\u5883\u540d\u79f0\u3002<\/p>\n\n\n\n<p>\u516d\u3001\u5b89\u88c5\u4f9d\u8d56\u5e93<\/p>\n\n\n\n<p>pip install -r requirements.txt<\/p>\n\n\n\n<p>\u5982\u679c\u4e0b\u8f7d\u6162\uff0c\u53ef\u4f7f\u7528\u56fd\u5185\u955c\u50cf\uff1a<\/p>\n\n\n\n<p>pip install -r requirements.txt -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n\n\n\n<p>\u4e03\u3001\u6a21\u578b\u6743\u91cd\u4e0b\u8f7d<\/p>\n\n\n\n<p>UniPic-2 \u901a\u5e38\u9700\u8981\u5355\u72ec\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\u6587\u4ef6\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<p>\u4e3b\u6a21\u578b\u6743\u91cd<\/p>\n\n\n\n<p>\u63a7\u5236\u6a21\u578b(\u53ef\u9009)<\/p>\n\n\n\n<p>\u8f85\u52a9\u589e\u5f3a\u6a21\u578b<\/p>\n\n\n\n<p>\u5c06\u4e0b\u8f7d\u597d\u7684\u6743\u91cd\u6587\u4ef6\u653e\u5165\u6307\u5b9a\u76ee\u5f55\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<p>UniPic-2\/ \u251c\u2500 models\/ \u2502 \u251c\u2500 unipic2_base.pth \u2502 \u251c\u2500 unipic2_enhance.pth<\/p>\n\n\n\n<p>\u516b\u3001\u542f\u52a8 UniPic-2 \u672c\u5730\u670d\u52a1<\/p>\n\n\n\n<p>\u5e38\u89c1\u542f\u52a8\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>python app.py<\/p>\n\n\n\n<p>\u6216\uff1a<\/p>\n\n\n\n<p>python webui.py<\/p>\n\n\n\n<p>\u542f\u52a8\u6210\u529f\u540e\uff0c\u7ec8\u7aef\u4f1a\u663e\u793a\u7c7b\u4f3c\uff1a<\/p>\n\n\n\n<p>Running on http:\/\/127.0.0.1:7860<\/p>\n\n\n\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u8be5\u5730\u5740\u5373\u53ef\u8fdb\u5165 UniPic-2 \u53ef\u89c6\u5316\u754c\u9762\u3002<\/p>\n\n\n\n<p>\u4e5d\u3001\u57fa\u672c\u4f7f\u7528\u8bf4\u660e<\/p>\n\n\n\n<p>\u5728 Web UI \u4e2d\u901a\u5e38\u53ef\u4ee5\u770b\u5230\u4ee5\u4e0b\u529f\u80fd\u6a21\u5757\uff1a<\/p>\n\n\n\n<p>\u56fe\u7247\u4e0a\u4f20\u533a\u57df<\/p>\n\n\n\n<p>\u53c2\u6570\u8bbe\u7f6e(\u5206\u8fa8\u7387\u3001\u5f3a\u5ea6\u3001\u6b65\u6570\u7b49)<\/p>\n\n\n\n<p>\u5904\u7406\u6a21\u5f0f(\u589e\u5f3a \/ \u4fee\u590d \/ \u98ce\u683c\u5316)<\/p>\n\n\n\n<p>\u8f93\u51fa\u9884\u89c8\u4e0e\u4e0b\u8f7d<\/p>\n\n\n\n<p>\u5efa\u8bae\u65b0\u624b\u53c2\u6570\uff1a<\/p>\n\n\n\n<p>\u5206\u8fa8\u7387\uff1a1024\u00d71024<\/p>\n\n\n\n<p>\u63a8\u7406\u6b65\u6570\uff1a20\u201330<\/p>\n\n\n\n<p>\u5f3a\u5ea6\uff1a0.6\u20130.8<\/p>\n\n\n\n<p>\u5341\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6cd5<\/p>\n\n\n\n<p>1. \u663e\u5b58\u4e0d\u8db3(CUDA out of memory)<\/p>\n\n\n\n<p>\u964d\u4f4e\u5206\u8fa8\u7387<\/p>\n\n\n\n<p>\u51cf\u5c11 batch size<\/p>\n\n\n\n<p>\u5173\u95ed\u5176\u4ed6\u5360\u7528\u663e\u5b58\u7684\u8f6f\u4ef6<\/p>\n\n\n\n<p>2. \u542f\u52a8\u62a5\u9519\u627e\u4e0d\u5230\u6a21\u5757<\/p>\n\n\n\n<p>ModuleNotFoundError<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p>pip install \u7f3a\u5931\u6a21\u5757\u540d<\/p>\n\n\n\n<p>3. \u6d4f\u89c8\u5668\u65e0\u6cd5\u8bbf\u95ee<\/p>\n\n\n\n<p>\u786e\u8ba4\u7ec8\u7aef\u672a\u62a5\u9519<\/p>\n\n\n\n<p>\u68c0\u67e5\u7aef\u53e3\u662f\u5426\u88ab\u5360\u7528<\/p>\n\n\n\n<p>\u5c1d\u8bd5\u66f4\u6362\u7aef\u53e3\u542f\u52a8<\/p>\n\n\n\n<p>\u5341\u4e00\u3001\u6027\u80fd\u4f18\u5316\u5efa\u8bae<\/p>\n\n\n\n<p>\u4f7f\u7528 FP16 \/ \u534a\u7cbe\u5ea6\u6a21\u5f0f<\/p>\n\n\n\n<p>\u542f\u7528 xformers \/ attention \u4f18\u5316<\/p>\n\n\n\n<p>\u5c06\u6a21\u578b\u653e\u5728 SSD \u4e0a<\/p>\n\n\n\n<p>Windows \u7528\u6237\u5173\u95ed\u4e0d\u5fc5\u8981\u7684\u540e\u53f0\u7a0b\u5e8f<\/p>\n\n\n\n<p>UniPic-2 \u7684\u672c\u5730\u90e8\u7f72\u5e76\u4e0d\u590d\u6742\uff0c\u5173\u952e\u5728\u4e8e\u73af\u5883\u914d\u7f6e\u6b63\u786e + \u6a21\u578b\u6587\u4ef6\u653e\u7f6e\u5230\u4f4d\u3002\u4e00\u65e6\u90e8\u7f72\u5b8c\u6210\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728\u672c\u5730\u5b89\u5168\u3001\u9ad8\u6548\u5730\u8fdb\u884c\u5404\u7c7b\u56fe\u50cf\u5904\u7406\u4efb\u52a1\uff0c\u65e0\u9700\u4f9d\u8d56\u4e91\u7aef\u670d\u52a1\uff0c\u9002\u5408\u957f\u671f\u4f7f\u7528\u548c\u4e8c\u6b21\u5f00\u53d1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UniPic-2\u5728ai\u56fe\u50cf\u5904\u7406\u6280\u672f\u83b7\u5f97\u7a81\u7834\u589e\u957f,\u62e5\u6709\u66f4\u5f3a\u7684\u98ce&hellip;<\/p>\n","protected":false},"author":2,"featured_media":218,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zixun"],"views":66,"_links":{"self":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":2,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/216\/revisions\/221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media\/218"}],"wp:attachment":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}