{"id":102101,"date":"2022-09-06T08:21:08","date_gmt":"2022-09-05T23:21:08","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=102101"},"modified":"2022-09-06T08:21:08","modified_gmt":"2022-09-05T23:21:08","slug":"stable-diffusion-intel-cpu","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/stable-diffusion-intel-cpu\/","title":{"rendered":"AI\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u308b\u300cStable Diffusion\u300d\u3092Intel CPU\u306e\u307f\u3067\u52d5\u304b\u3059\u65b9\u6cd5"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/09\/s_20220905_145415.jpg\" alt=\"S 20220905 145415\" title=\"s_20220905_145415.jpg\" border=\"0\" width=\"1218\" height=\"773\" \/><\/p>\n<p>AI\u3092\u5229\u7528\u3057\u3066\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u308b\u300c<a href=\"https:\/\/github.com\/CompVis\/stable-diffusion\">Stable Diffusion<\/a>\u300d\u3068\u547c\u3070\u308c\u308b\u30c4\u30fc\u30eb\u304c\u4eba\u6c17\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001Stable Diffusion\u306e\u30aa\u30ea\u30b8\u30ca\u30eb\u7248\u306f\u3001\u65b0\u3057\u3081\u306eNvidia\u306eGPU\u304c\u5fc5\u8981\u3067\u3001\u81ea\u5206\u306e\u6301\u3063\u3066\u3044\u308bPC\u3067\u306f\u5b9f\u884c\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u65b9\u3082\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u5e78\u3044\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u3001Stable Diffusion\u3092Intel CPU\u306e\u307f\u3067\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u6539\u9020\u3057\u305f\u300c<a href=\"https:\/\/github.com\/bes-dev\/stable_diffusion.openvino\">stable_diffusion.openvino<\/a>\u300d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Intel\u304c\u63d0\u4f9b\u3059\u308bOpenVINO\u3068\u4e92\u63db\u6027\u3092\u6301\u3064CPU\u4e0a\u3067\u3042\u308c\u3070\u3001Linux\u3001Windows\u3001macOS\u306e\u5404\u74b0\u5883\u4e0a\u306ePython 3.8\u4ee5\u964d\u3067\u52d5\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30e6\u30fc\u30b6\u30fc\u304c\u591a\u3044\u3067\u3042\u308d\u3046\u3001Windows\u74b0\u5883\u3067WSL\u3092\u4f7f\u3044\u3001stable_diffusion.openvin\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>pyenv\u306e\u8a2d\u5b9a<\/h2>\n<p>WSL\u306fUbuntu\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Python\u306f<code>apt install python<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u4eca\u56de\u306f\u3084\u308a\u76f4\u3057\u306e\u624b\u8efd\u3055\u3092\u8003\u3048\u3066pyenv\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059(pyenv\u8a2d\u5b9a\u6e08\u307f\u306e\u65b9\u306f\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044)\u3002<\/p>\n<p>\u306a\u304a\u3001\u691c\u7d22\u3059\u308b\u3068pyenv+virtualenv\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001virtualenv\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u306e\u3067\u4eca\u56de\u306fpyenv\u306e\u307f\u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305a\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092apt\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\nsudo apt install build-essential\r\nsudo apt install libssl-dev libffi-dev libncurses5-dev zlib1g zlib1g-dev libreadline-dev libbz2-dev libsqlite3-dev libgl1-mesa-dev make gcc\r\n<\/pre>\n<p>pyenv\u3092clone\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\ngit clone https:\/\/github.com\/yyuu\/pyenv.git ~\/.pyenv\r\n<\/pre>\n<p>.bashrc\u306b\u4ee5\u4e0b\u306e\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\ngit clone https:\/\/github.com\/yyuu\/pyenv.git ~\/.pyenv\r\nexport PYENV_ROOT=\"$HOME\/.pyenv\"\r\nexport PATH=\"$PYENV_ROOT\/bin:$PATH\"\r\neval \"$(pyenv init -)\"\r\n<\/pre>\n<p><code>source ~\/.bashrc<\/code>\u3059\u308b\u304b\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u8d77\u52d5\u3057\u306a\u304a\u3057\u307e\u3059\u3002pyenv\u304c\u5b9f\u884c\u3067\u304d\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<h2>Python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>pyenv\u3092\u4f7f\u3063\u3066Python 3.8.x\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\npyenv install 3.8.12\r\npyenv global 3.8.12\r\n<\/pre>\n<p><code>python --version<\/code>\u3067\u300cPython 3.8.12\u300d\u3068\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/09\/s_20220905_151345.jpg\" alt=\"S 20220905 151345\" title=\"s_20220905_151345.jpg\" border=\"0\" width=\"1218\" height=\"697\" \/><\/p>\n<h2>stable_diffusion.openvino\u3092\u5b9f\u884c<\/h2>\n<p>stable_diffusion.openvin\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092clone\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\ngit clone https:\/\/github.com\/bes-dev\/stable_diffusion.openvino\r\n<\/pre>\n<p>pip\u30b3\u30de\u30f3\u30c9\u3067\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\ncd stable_diffusion.openvino\r\npip install -r requirements.txt\r\n<\/pre>\n<p>\u3044\u3088\u3044\u3088stable_diffusion.openvino\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002prompt\u306e\u5f8c\u306e\u6587\u5b57\u5217\u306f\u81ea\u5206\u3067\u5de5\u592b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059(\u305d\u306e\u6587\u5b57\u5217\u306b\u3061\u306a\u3093\u3060\u753b\u50cf\u304c\u751f\u6210\u3055\u308c\u307e\u3059)\u3002<\/p>\n<pre>\r\npython demo.py --prompt \"origami\"\r\n<\/pre>\n<p>\u6210\u529f\u3059\u308b\u3068\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306b<code>output.png<\/code>\u304c\u66f8\u304d\u51fa\u3055\u308c\u307e\u3059\u3002<code>explorer.exe .<\/code>\u3057\u3066\u30a8\u30af\u30b9\u30d7\u30ed\u30fc\u30e9\u30fc\u3092\u8d77\u52d5\u3057\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/09\/s_20220905_153151.jpg\" alt=\"S 20220905 153151\" title=\"s_20220905_153151.jpg\" border=\"0\" width=\"1280\" height=\"745\" \/><\/p>\n<p>stable_diffusion.openvino\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b5\u30f3\u30d7\u30eb\u3082\u63b2\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u8abf\u6574\u3059\u308b\u3053\u3068\u3067\u65b0\u305f\u306a\u767a\u898b\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>Text-To-Image\u306e\u30b5\u30f3\u30d7\u30eb<\/p>\n<pre>\r\npython demo.py --prompt \"Street-art painting of Emilia Clarke in style of Banksy, photorealism\"\r\n<\/pre>\n<p>Image-To-Image\u306e\u30b5\u30f3\u30d7\u30eb<\/p>\n<pre>\r\npython demo.py --prompt \"Photo of Emilia Clarke with a bright red hair\" --init-image .\/data\/input.png --strength 0.5\r\n<\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Stable Diffusion\u3092Intel CPU\u306e\u307f\u3067\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u300cstable_diffusion.openvino\u300d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002Nvidia\u306eGPU\u306f\u306a\u3044\u304cIntel CPU\u306f\u3042\u308b\u3068\u3044\u3046\u65b9\u306f\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI\u3092\u5229\u7528\u3057\u3066\u753b\u50cf\u3092\u751f\u6210\u3067\u304d\u308b\u300cStable Diffusion\u300d\u3068\u547c\u3070\u308c\u308b\u30c4\u30fc\u30eb\u304c\u4eba\u6c17\u3067\u3059\u3002 \u305f\u3060\u3057\u3001Stable Diffusion\u306e\u30aa\u30ea\u30b8\u30ca\u30eb\u7248\u306f\u3001\u65b0\u3057\u3081\u306eNvidia\u306eGPU\u304c\u5fc5\u8981\u3067\u3001\u81ea\u5206\u306e\u6301\u3063\u3066\u3044\u308bPC\u3067\u306f\u5b9f\u884c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":102109,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[2047],"tags":[1004],"class_list":["post-102101","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips","tag-staccal"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/102101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=102101"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/102101\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/102109"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=102101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=102101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=102101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}