{"id":245,"date":"2026-01-22T10:39:47","date_gmt":"2026-01-22T02:39:47","guid":{"rendered":"https:\/\/www.starverse-ai.com\/guide\/?p=245"},"modified":"2026-01-22T10:40:30","modified_gmt":"2026-01-22T02:40:30","slug":"omnigen2%e5%9c%a8%e7%ba%bf%e5%ae%89%e8%a3%85%e5%9b%be%e5%83%8f%e7%94%9f%e6%88%90%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.starverse-ai.com\/guide\/archives\/245","title":{"rendered":"OmniGen2\u5728\u7ebf\u5b89\u88c5(\u56fe\u50cf\u751f\u6210\u6a21\u578b)"},"content":{"rendered":"\n<p>OmniGen2\u6765\u81ea\u5317\u4eac\u667a\u6e90\u4eba\u5de5\u667a\u80fd\u7814\u7a76\u9662\u7684\u9ad8\u7ea7ai\u591a\u6a21\u6001\u751f\u6210\u6a21\u578b,\u5728\u6587\u672c\u751f\u6210\u548c\u56fe\u50cf\u5904\u7406\u65b9\u9762\u6ee1\u8db3\u7528\u6237\u6240\u9700,\u5165\u95e8\u5bb9\u6613,\u5c0f\u767d\u4e5f\u53ef\u4ee5\u5feb\u901f\u4e0a\u624b\u3002<\/p>\n\n\n\n<p>\u4e00\u3001OmniGen2 \u662f\u4ec0\u4e48?<\/p>\n\n\n\n<p>OmniGen2 \u662f\u65b0\u4e00\u4ee3 \u591a\u6a21\u6001\u751f\u6210\u6a21\u578b\uff0c\u4e3b\u8981\u9762\u5411\u56fe\u50cf\u751f\u6210\u4e0e\u7406\u89e3\u573a\u666f\uff0c\u652f\u6301\u6587\u672c\u751f\u6210\u56fe\u7247\u3001\u56fe\u50cf\u7f16\u8f91\u3001\u98ce\u683c\u8fc1\u79fb\u7b49\u80fd\u529b\u3002\u4e0e\u672c\u5730\u90e8\u7f72\u4e0d\u540c\uff0c\u5728\u7ebf\u5b89\u88c5\u65b9\u5f0f\u66f4\u9002\u5408\u666e\u901a\u7528\u6237\u548c\u5f00\u53d1\u8005\uff0c\u7279\u70b9\u662f\uff1a<\/p>\n\n\n\n<p>\u65e0\u9700\u9ad8\u6027\u80fd\u672c\u5730\u663e\u5361<\/p>\n\n\n\n<p>\u4f9d\u6258\u4e91\u7aef\u7b97\u529b\uff0c\u5f00\u7bb1\u5373\u7528<\/p>\n\n\n\n<p>\u90e8\u7f72\u5feb\u3001\u7ef4\u62a4\u6210\u672c\u4f4e<\/p>\n\n\n\n<p>\u9002\u5408\u6d4b\u8bd5\u3001\u6f14\u793a\u3001API \u96c6\u6210<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u53ea\u662f\u60f3\u5feb\u901f\u4f53\u9a8c OmniGen2 \u7684\u80fd\u529b\uff0c\u5728\u7ebf\u5b89\u88c5\u662f\u6700\u7701\u4e8b\u7684\u9009\u62e9\u3002<\/p>\n\n\n\n<p>\u4e8c\u3001\u5728\u7ebf\u5b89\u88c5\u524d\u7684\u51c6\u5907<\/p>\n\n\n\n<p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u8bf7\u786e\u8ba4\u4ee5\u4e0b\u6761\u4ef6\u5df2\u7ecf\u6ee1\u8db3\uff1a<\/p>\n\n\n\n<p>1. \u57fa\u672c\u73af\u5883<\/p>\n\n\n\n<p>\u4e00\u53f0\u53ef\u6b63\u5e38\u8bbf\u95ee\u4e92\u8054\u7f51\u7684\u7535\u8111<\/p>\n\n\n\n<p>\u73b0\u4ee3\u6d4f\u89c8\u5668(Chrome \/ Edge \/ Firefox)<\/p>\n\n\n\n<p>\u7a33\u5b9a\u7f51\u7edc\u8fde\u63a5<\/p>\n\n\n\n<p>2. \u8d26\u53f7\u51c6\u5907<\/p>\n\n\n\n<p>\u901a\u5e38\u9700\u8981\u4ee5\u4e0b\u81f3\u5c11\u4e00\u9879\uff1a<\/p>\n\n\n\n<p>Hugging Face \u8d26\u53f7<\/p>\n\n\n\n<p>\u4e91\u5e73\u53f0\u8d26\u53f7(\u5982\u652f\u6301 GPU \u7684 Notebook \/ WebUI \u5e73\u53f0)<\/p>\n\n\n\n<p>\u5728\u7ebf\u5b89\u88c5\u4e0d\u9700\u8981\u4f60\u5728\u672c\u5730\u914d\u7f6e CUDA \u6216 PyTorch\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"304\" src=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/OmniGen2\u56fe\u50cf\u5904\u7406.jpg\" alt=\"\" class=\"wp-image-246\" srcset=\"https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/OmniGen2\u56fe\u50cf\u5904\u7406.jpg 549w, https:\/\/www.starverse-ai.com\/guide\/wp-content\/uploads\/2026\/01\/OmniGen2\u56fe\u50cf\u5904\u7406-300x166.jpg 300w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/figure>\n<\/div>\n\n\n<p>\u4e09\u3001OmniGen2 \u5728\u7ebf\u5b89\u88c5\u601d\u8def\u8bf4\u660e<\/p>\n\n\n\n<p>\u6240\u8c13\u201c\u5728\u7ebf\u5b89\u88c5\u201d\uff0c\u672c\u8d28\u662f\u901a\u8fc7 \u4e91\u7aef\u8fd0\u884c\u73af\u5883 \u62c9\u53d6 OmniGen2 \u6a21\u578b\u5e76\u542f\u52a8 Web \u670d\u52a1\uff0c\u5e38\u89c1\u5f62\u5f0f\u5305\u62ec\uff1a<\/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\"><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=\"hivisionidphotos\" class=\"wp-image-126\"\/><\/figure>\n<\/div>\n\n\n<p>\u5728\u7ebf Notebook(\u70b9\u51fb\u8fd0\u884c)<\/p>\n\n\n\n<p>\u5b98\u65b9\u6216\u793e\u533a Web UI<\/p>\n\n\n\n<p>\u4e91\u7aef API \u670d\u52a1<\/p>\n\n\n\n<p>\u6574\u4e2a\u8fc7\u7a0b\u53ef\u6982\u62ec\u4e3a\u56db\u6b65\uff1a<\/p>\n\n\n\n<p>\u521b\u5efa\u5728\u7ebf\u8fd0\u884c\u73af\u5883<\/p>\n\n\n\n<p>\u5b89\u88c5\u4f9d\u8d56<\/p>\n\n\n\n<p>\u4e0b\u8f7d OmniGen2 \u6a21\u578b<\/p>\n\n\n\n<p>\u542f\u52a8 Web \u754c\u9762\u6216 API<\/p>\n\n\n\n<p>\u56db\u3001OmniGen2 \u5728\u7ebf\u5b89\u88c5\u6b65\u9aa4(\u901a\u7528\u6d41\u7a0b)<\/p>\n\n\n\n<p>\u6b65\u9aa4\u4e00\uff1a\u521b\u5efa\u5728\u7ebf\u8fd0\u884c\u73af\u5883<\/p>\n\n\n\n<p>\u8fdb\u5165\u652f\u6301 Python + GPU \u7684\u5728\u7ebf\u5e73\u53f0\uff0c\u65b0\u5efa\u4e00\u4e2a\u8fd0\u884c\u5b9e\u4f8b\u6216 Notebook\uff0c\u786e\u4fdd\uff1a<\/p>\n\n\n\n<p>Python \u7248\u672c \u2265 3.9<\/p>\n\n\n\n<p>\u5df2\u542f\u7528 GPU(\u63a8\u8350\uff0c\u4f46\u975e\u5f3a\u5236)<\/p>\n\n\n\n<p>\u521b\u5efa\u5b8c\u6210\u540e\uff0c\u8fdb\u5165\u547d\u4ee4\u884c\u6216 Notebook \u5355\u5143\u3002<\/p>\n\n\n\n<p>\u6b65\u9aa4\u4e8c\uff1a\u5b89\u88c5\u57fa\u7840\u4f9d\u8d56<\/p>\n\n\n\n<p>\u5728\u5728\u7ebf\u73af\u5883\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p>pip install &#8211;upgrade pip<\/p>\n\n\n\n<p>\u7136\u540e\u5b89\u88c5 OmniGen2 \u8fd0\u884c\u6240\u9700\u4f9d\u8d56\uff1a<\/p>\n\n\n\n<p>pip install torch torchvision transformers diffusers accelerate<\/p>\n\n\n\n<p>\u5982\u679c\u5e73\u53f0\u5df2\u9884\u88c5\u6df1\u5ea6\u5b66\u4e60\u73af\u5883\uff0c\u53ef\u8df3\u8fc7\u90e8\u5206\u6b65\u9aa4\u3002<\/p>\n\n\n\n<p>\u6b65\u9aa4\u4e09\uff1a\u5728\u7ebf\u4e0b\u8f7d OmniGen2 \u6a21\u578b<\/p>\n\n\n\n<p>\u9996\u6b21\u8fd0\u884c\u65f6\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4ece\u6a21\u578b\u4ed3\u5e93\u62c9\u53d6 OmniGen2 \u6743\u91cd\u6587\u4ef6\u3002\u4f60\u53ea\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u6307\u5b9a\u6a21\u578b\u540d\u79f0\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<p>model_name = &#8220;OmniGen2&#8221;<\/p>\n\n\n\n<p>\u6a21\u578b\u6587\u4ef6\u4f1a\u7f13\u5b58\u5230\u4e91\u7aef\u73af\u5883\u4e2d\uff0c\u4e0b\u6b21\u542f\u52a8\u65e0\u9700\u91cd\u590d\u4e0b\u8f7d\u3002<\/p>\n\n\n\n<p>\u6b65\u9aa4\u56db\uff1a\u542f\u52a8\u5728\u7ebf WebUI \u6216\u63a5\u53e3<\/p>\n\n\n\n<p>\u542f\u52a8\u670d\u52a1\u540e\uff0c\u901a\u5e38\u4f1a\u751f\u6210\u4e00\u4e2a\u8bbf\u95ee\u5730\u5740\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<p>Running on public URL<\/p>\n\n\n\n<p>\u70b9\u51fb\u94fe\u63a5\u5373\u53ef\u8fdb\u5165 OmniGen2 \u7684\u5728\u7ebf\u64cd\u4f5c\u754c\u9762\uff0c\u652f\u6301\uff1a<\/p>\n\n\n\n<p>\u6587\u672c\u751f\u6210\u56fe\u7247<\/p>\n\n\n\n<p>\u4e0a\u4f20\u56fe\u7247\u8fdb\u884c\u7f16\u8f91<\/p>\n\n\n\n<p>\u53c2\u6570\u8c03\u6574(\u5206\u8fa8\u7387\u3001\u98ce\u683c\u3001\u6b65\u6570\u7b49)<\/p>\n\n\n\n<p>\u4e94\u3001\u5728\u7ebf\u4f7f\u7528 OmniGen2 \u7684\u57fa\u672c\u6d41\u7a0b<\/p>\n\n\n\n<p>\u8f93\u5165\u63d0\u793a\u8bcd(Prompt)<\/p>\n\n\n\n<p>\u9009\u62e9\u8f93\u51fa\u5c3a\u5bf8\u4e0e\u98ce\u683c<\/p>\n\n\n\n<p>\u70b9\u51fb\u751f\u6210<\/p>\n\n\n\n<p>\u7b49\u5f85\u4e91\u7aef\u8ba1\u7b97\u5b8c\u6210<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u6216\u7ee7\u7eed\u7f16\u8f91\u751f\u6210\u7ed3\u679c<\/p>\n\n\n\n<p>\u6574\u4e2a\u8fc7\u7a0b\u4e0d\u5360\u7528\u672c\u5730\u7b97\u529b\uff0c\u6d4f\u89c8\u5668\u5373\u53ef\u5b8c\u6210\u3002<\/p>\n\n\n\n<p>\u516d\u3001\u5728\u7ebf\u5b89\u88c5\u65b9\u5f0f\u7684\u4f18\u7f3a\u70b9<\/p>\n\n\n\n<p>\u4f18\u70b9<\/p>\n\n\n\n<p>\u51e0\u4e4e\u96f6\u914d\u7f6e<\/p>\n\n\n\n<p>\u4e0d\u4f9d\u8d56\u672c\u5730\u786c\u4ef6<\/p>\n\n\n\n<p>\u9002\u5408\u521d\u5b66\u8005<\/p>\n\n\n\n<p>\u53ef\u5feb\u901f\u9a8c\u8bc1\u6a21\u578b\u6548\u679c<\/p>\n\n\n\n<p>\u7f3a\u70b9<\/p>\n\n\n\n<p>\u4f9d\u8d56\u7f51\u7edc\u7a33\u5b9a\u6027<\/p>\n\n\n\n<p>\u514d\u8d39\u5e73\u53f0\u53ef\u80fd\u6709\u9650\u5236<\/p>\n\n\n\n<p>\u9690\u79c1\u9700\u6ce8\u610f\u5e73\u53f0\u653f\u7b56<\/p>\n\n\n\n<p>\u4e03\u3001\u5e38\u89c1\u95ee\u9898 FAQ<\/p>\n\n\n\n<p>Q1\uff1aOmniGen2 \u5728\u7ebf\u5b89\u88c5\u9700\u8981\u663e\u5361\u5417?<\/p>\n\n\n\n<p>\u4e0d\u5f3a\u5236\u9700\u8981\u3002\u5982\u679c\u5e73\u53f0\u63d0\u4f9b GPU\uff0c\u751f\u6210\u901f\u5ea6\u4f1a\u660e\u663e\u66f4\u5feb;CPU \u4e5f\u53ef\u4ee5\u8fd0\u884c\uff0c\u4f46\u901f\u5ea6\u8f83\u6162\u3002<\/p>\n\n\n\n<p>Q2\uff1a\u4e3a\u4ec0\u4e48\u7b2c\u4e00\u6b21\u542f\u52a8\u5f88\u6162?<\/p>\n\n\n\n<p>\u9996\u6b21\u542f\u52a8\u9700\u8981\u4e0b\u8f7d\u6a21\u578b\u6743\u91cd\u6587\u4ef6\uff0c\u4f53\u79ef\u8f83\u5927\uff0c\u5c5e\u4e8e\u6b63\u5e38\u73b0\u8c61\uff0c\u4e4b\u540e\u4f1a\u660e\u663e\u52a0\u5feb\u3002<\/p>\n\n\n\n<p>Q3\uff1a\u5728\u7ebf\u73af\u5883\u5173\u95ed\u540e\u6a21\u578b\u4f1a\u4e22\u5931\u5417?<\/p>\n\n\n\n<p>\u4e34\u65f6\u5b9e\u4f8b\uff1a\u53ef\u80fd\u4f1a\u6e05\u7a7a\u7f13\u5b58<\/p>\n\n\n\n<p>\u6301\u4e45\u5316\u73af\u5883\uff1a\u6a21\u578b\u4f1a\u4fdd\u7559<\/p>\n\n\n\n<p>\u5efa\u8bae\u4f7f\u7528\u652f\u6301\u6301\u4e45\u5b58\u50a8\u7684\u5e73\u53f0\u3002<\/p>\n\n\n\n<p>Q4\uff1a\u53ef\u4ee5\u628a OmniGen2 \u63a5\u5165\u81ea\u5df1\u7684\u5e94\u7528\u5417?<\/p>\n\n\n\n<p>\u53ef\u4ee5\u3002\u5728\u7ebf\u73af\u5883\u901a\u5e38\u652f\u6301\uff1a<\/p>\n\n\n\n<p>REST API<\/p>\n\n\n\n<p>Python \u8c03\u7528<\/p>\n\n\n\n<p>WebUI \u4e8c\u6b21\u5f00\u53d1<\/p>\n\n\n\n<p>Q5\uff1a\u5728\u7ebf\u5b89\u88c5\u548c\u672c\u5730\u90e8\u7f72\u5982\u4f55\u9009\u62e9?<\/p>\n\n\n\n<p>\u4f53\u9a8c \/ \u6f14\u793a \/ \u5b66\u4e60 \u2192 \u5728\u7ebf\u5b89\u88c5<\/p>\n\n\n\n<p>\u957f\u671f\u4f7f\u7528 \/ \u79c1\u6709\u6570\u636e \/ \u79bb\u7ebf\u73af\u5883 \u2192 \u672c\u5730\u90e8\u7f72<\/p>\n\n\n\n<p>Q6\uff1a\u751f\u6210\u5931\u8d25\u6216\u62a5\u9519\u600e\u4e48\u529e?<\/p>\n\n\n\n<p>\u5e38\u89c1\u89e3\u51b3\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<p>\u91cd\u542f\u8fd0\u884c\u73af\u5883<\/p>\n\n\n\n<p>\u964d\u4f4e\u751f\u6210\u5206\u8fa8\u7387<\/p>\n\n\n\n<p>\u68c0\u67e5\u663e\u5b58\u6216\u914d\u989d\u9650\u5236<\/p>\n\n\n\n<p>OmniGen2 \u7684\u5728\u7ebf\u5b89\u88c5\u65b9\u5f0f\uff0c\u6700\u5927\u4f18\u52bf\u5728\u4e8e\u7b80\u5355\u3001\u5feb\u901f\u3001\u4f4e\u95e8\u69db\u3002\u4f60\u4e0d\u9700\u8981\u5173\u5fc3\u590d\u6742\u7684\u4f9d\u8d56\u3001\u663e\u5361\u9a71\u52a8\u6216\u7cfb\u7edf\u517c\u5bb9\u95ee\u9898\uff0c\u53ea\u9700\u51c6\u5907\u4e00\u4e2a\u5728\u7ebf\u8fd0\u884c\u73af\u5883\uff0c\u5c31\u80fd\u5728\u51e0\u5206\u949f\u5185\u5b8c\u6210\u90e8\u7f72\u5e76\u5f00\u59cb\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OmniGen2\u6765\u81ea\u5317\u4eac\u667a\u6e90\u4eba\u5de5\u667a\u80fd\u7814\u7a76\u9662\u7684\u9ad8\u7ea7ai\u591a\u6a21\u6001\u751f&hellip;<\/p>\n","protected":false},"author":2,"featured_media":246,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-zixun"],"views":53,"_links":{"self":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/245","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=245"}],"version-history":[{"count":2,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/posts\/245\/revisions\/253"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media\/246"}],"wp:attachment":[{"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/media?parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/categories?post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.starverse-ai.com\/guide\/wp-json\/wp\/v2\/tags?post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}