[{"data":1,"prerenderedAt":406},["ShallowReactive",2],{"footer-settings":3,"post-shell:how-artists-can-set-up-their-own-neural-network-part-3-image-generation-2e7679f6959c":22,"post-body:how-artists-can-set-up-their-own-neural-network-part-3-image-generation-2e7679f6959c":79,"code-block:6a8e6ccf1f868:text:midnight":387,"code-block:6a8e6ccf1f86b:text:midnight":388,"code-block:6a8e6ccf1f86d:text:midnight":389,"code-block:6a8e6ccf1f86f:text:midnight":390,"code-block:6a8e6ccf1f872:text:midnight":391,"code-block:6a8e6ccf1f874:text:midnight":392,"code-block:6a8e6ccf1f876:text:midnight":393,"code-block:6a8e6ccf1f87a:text:midnight":394,"code-block:6a8e6ccf1f87c:text:midnight":395,"code-block:6a8e6ccf1f87f:text:midnight":396,"code-block:6a8e6ccf1f881:text:midnight":397,"code-block:6a8e6ccf1f884:text:midnight":398,"code-block:6a8e6ccf1f886:text:midnight":399,"code-block:6a8e6ccf1f888:text:midnight":391,"code-block:6a8e6ccf1f88a:text:midnight":400,"code-block:6a8e6ccf1f890:text:midnight":401,"code-block:6a8e6ccf1f892:text:midnight":402,"code-block:6a8e6ccf1f894:text:midnight":403,"code-block:6a8e6ccf1f896:text:midnight":404,"code-block:6a8e6ccf1f898:text:midnight":405},{"heading":4,"body":5,"links":6,"note":21},"Bottom line, still up front.","A small footer for global links, contact paths, and project context.",[7,10,13,16,19],{"label":8,"url":9},"About","http:\u002F\u002Fmy-website.localhost\u002Fabout#now",{"label":11,"url":12},"Case Studies","http:\u002F\u002Fmy-website.localhost\u002F#selected-work",{"label":14,"url":15},"Side Projects","http:\u002F\u002Fmy-website.localhost\u002Fside-projects",{"label":17,"url":18},"Writing","http:\u002F\u002Fmy-website.localhost\u002Fwriting",{"label":20,"url":9},"Now","",{"id":23,"slug":24,"date":25,"author":26,"title":29,"excerpt":30,"canonicalUrl":31,"featuredImage":32,"authorName":28,"featuredMedia":33,"blocks":78},"cG9zdDo1ODQ=","how-artists-can-set-up-their-own-neural-network-part-3-image-generation-2e7679f6959c","December 7, 2018",{"node":27},{"name":28},"Aslan French","How Artists Can Set Up Their Own Neural Network — Part 3 — Image Generation","Alright, so we’ve installed linux and the neural network now it’s time to actually run it! First though I want to apologize for the delay in getting these last two parts of the tutorial series out. As I&#8230;","https:\u002F\u002Fmedium.com\u002Fhackernoon\u002Fhow-artists-can-set-up-their-own-neural-network-part-3-image-generation-2e7679f6959c",{"node":33},{"id":34,"sourceUrl":35,"srcSet":36,"sizes":37,"altText":38,"mediaDetails":39},"cG9zdDo1ODU=","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5.jpg","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-300x188.jpg 300w, https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-1024x640.jpg 1024w, https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-768x480.jpg 768w, https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-1536x960.jpg 1536w, https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5.jpg 1920w","(max-width: 300px) 100vw, 300px","Aslan French's image-aebc8",{"width":40,"height":41,"sizes":42},1920,1200,[43,51,58,64,71],{"name":44,"sourceUrl":45,"width":46,"height":47,"mimeType":48,"file":49,"fileSize":50},"medium","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-300x188.jpg","300","188","image\u002Fjpeg","0KQjgixMClg67n5V5-300x188.jpg",10076,{"name":52,"sourceUrl":53,"width":54,"height":55,"mimeType":48,"file":56,"fileSize":57},"large","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-1024x640.jpg","1024","640","0KQjgixMClg67n5V5-1024x640.jpg",70615,{"name":59,"sourceUrl":60,"width":61,"height":61,"mimeType":48,"file":62,"fileSize":63},"thumbnail","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-150x150.jpg","150","0KQjgixMClg67n5V5-150x150.jpg",4599,{"name":65,"sourceUrl":66,"width":67,"height":68,"mimeType":48,"file":69,"fileSize":70},"medium_large","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-768x480.jpg","768","480","0KQjgixMClg67n5V5-768x480.jpg",44851,{"name":72,"sourceUrl":73,"width":74,"height":75,"mimeType":48,"file":76,"fileSize":77},"1536x1536","https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5-1536x960.jpg","1536","960","0KQjgixMClg67n5V5-1536x960.jpg",131211,[],[80,86,90,94,98,102,106,111,115,120,124,129,133,137,141,145,149,153,157,161,165,169,173,177,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,259,263,267,271,275,279,283,287,291,295,299,303,307,311,315,319,323,327,331,335,339,343,347,351,355,359,363,367,371,375,379,383],{"name":81,"clientId":82,"parentClientId":83,"renderedHtml":84,"attributes":85},"core\u002Fparagraph","6a8e6ccf1f85b",null,"\n\u003Cp class=\"wp-block-paragraph\">Alright, so we’ve installed linux and the neural network now it’s time to actually run it!\u003C\u002Fp>\n",{},{"name":81,"clientId":87,"parentClientId":83,"renderedHtml":88,"attributes":89},"6a8e6ccf1f85f","\n\u003Cp class=\"wp-block-paragraph\">First though I want to apologize for the delay in getting these last two parts of the tutorial series out. As I explained in my \u003Ca href=\"https:\u002F\u002Fwww.jackalope.tech\u002Fskonk-works\u002F?ref=hackernoon.com\">Skonk Works\u003C\u002Fa> post, I’ve been learning so fast that it’s actually been kind of hard to catch time to digest and write any of it down.\u003C\u002Fp>\n",{},{"name":81,"clientId":91,"parentClientId":83,"renderedHtml":92,"attributes":93},"6a8e6ccf1f860","\n\u003Cp class=\"wp-block-paragraph\">For instance, this tutorial series began with teaching you how to install Ubuntu 16.04, but support for Ubuntu 16.04 has just ended and you really should install Ubuntu 18.04, which is what I did after wiping my desktop and turning it into a fulltime personal cloud server! This is good because now I have a completely dedicated Linux machine to run neural network batch jobs on 24\u002F7! The process of figuring out this new workflow though has been very chaotic and as a result I only had enough time recently to make sure my work pipeline was stable and went through the trouble of reinstalling Deep Style (I’ve also updated \u003Ca href=\"https:\u002F\u002Fwww.jackalope.tech\u002Fhow-artists-can-set-up-their-own-neural-network-part-2-neural-network-install\u002F?ref=hackernoon.com\">the original part 2 article\u003C\u002Fa> with some tips on installing it on 18.04)\u003C\u002Fp>\n",{},{"name":81,"clientId":95,"parentClientId":83,"renderedHtml":96,"attributes":97},"6a8e6ccf1f861","\n\u003Cp class=\"wp-block-paragraph\">The good news is, now I know a ton more about Linux! I’ve got some other irons in the fire that I need to tend to right now, but I’m hoping to do a sequel or update to the series using what I’ve learned to create an even easier and largely automated process for artists and other non-programmers to use.\u003C\u002Fp>\n",{},{"name":81,"clientId":99,"parentClientId":83,"renderedHtml":100,"attributes":101},"6a8e6ccf1f862","\n\u003Cp class=\"wp-block-paragraph\">For now though I want to finish this series out properly and so this week we’re going to be talking about how to actually actually run DeepStyle and how that process can be turned into a script which can generate a massive amount of imagery for you to use. At the end of the tutorial I’ll even include a link to a Bash shell script that you can just plug your own variables into!\u003C\u002Fp>\n",{},{"name":81,"clientId":103,"parentClientId":83,"renderedHtml":104,"attributes":105},"6a8e6ccf1f863","\n\u003Cp class=\"wp-block-paragraph\">To run neural style you need to open up your terminal.\u003C\u002Fp>\n",{},{"name":107,"clientId":108,"parentClientId":83,"renderedHtml":109,"attributes":110},"core\u002Fimage","6a8e6ccf1f864","\n\u003Cfigure class=\"wp-block-image size-full\">\u003Cimg src=\"https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0KQjgixMClg67n5V5.jpg\" alt=\"Aslan French&#039;s image-aebc8\" class=\"wp-image-585\"\u002F>\u003C\u002Ffigure>\n",{},{"name":81,"clientId":112,"parentClientId":83,"renderedHtml":113,"attributes":114},"6a8e6ccf1f865","\n\u003Cp class=\"wp-block-paragraph\">my linux desktop looks way different now\u003C\u002Fp>\n",{},{"name":116,"clientId":117,"parentClientId":83,"renderedHtml":118,"attributes":119},"core\u002Fheading","6a8e6ccf1f866","\n\u003Ch4 class=\"wp-block-heading\">How to run a DeepStyle command\u003C\u002Fh4>\n",{},{"name":81,"clientId":121,"parentClientId":83,"renderedHtml":122,"attributes":123},"6a8e6ccf1f867","\n\u003Cp class=\"wp-block-paragraph\">You then need to:\u003C\u002Fp>\n",{},{"name":125,"clientId":126,"parentClientId":83,"renderedHtml":127,"attributes":128},"core\u002Fcode","6a8e6ccf1f868","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>cd ~\u002Fneural-style\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":130,"parentClientId":83,"renderedHtml":131,"attributes":132},"6a8e6ccf1f869","\n\u003Cp class=\"wp-block-paragraph\">This will “change directory” to the folder “neural-style” where the neural network implementation DeepStyle has been installed.\u003C\u002Fp>\n",{},{"name":81,"clientId":134,"parentClientId":83,"renderedHtml":135,"attributes":136},"6a8e6ccf1f86a","\n\u003Cp class=\"wp-block-paragraph\">To run the neural network you need to run a command. In the last tutorial I told you to use the following command to test to see if your install was working correctly:\u003C\u002Fp>\n",{},{"name":125,"clientId":138,"parentClientId":83,"renderedHtml":139,"attributes":140},"6a8e6ccf1f86b","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>th neural_style.lua -gpu 0 -print_iter 1\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":142,"parentClientId":83,"renderedHtml":143,"attributes":144},"6a8e6ccf1f86c","\n\u003Cp class=\"wp-block-paragraph\">Let’s break this down piece by piece.\u003C\u002Fp>\n",{},{"name":125,"clientId":146,"parentClientId":83,"renderedHtml":147,"attributes":148},"6a8e6ccf1f86d","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>th\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":150,"parentClientId":83,"renderedHtml":151,"attributes":152},"6a8e6ccf1f86e","\n\u003Cp class=\"wp-block-paragraph\">\u003Ccode>th\u003C\u002Fcode> is short for &quot;torch&quot; which is the neural network framework you installed. You are calling it as a program to do something.\u003C\u002Fp>\n",{},{"name":125,"clientId":154,"parentClientId":83,"renderedHtml":155,"attributes":156},"6a8e6ccf1f86f","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>neural_style.lua\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":158,"parentClientId":83,"renderedHtml":159,"attributes":160},"6a8e6ccf1f870","\n\u003Cp class=\"wp-block-paragraph\">\u003Ccode>neural_style.lua\u003C\u002Fcode> is the script created to run DeepStyle. It has the file extension of &quot;lua&quot; because it is written in the lua language. Some computer programs have to be compiled (which you did in the last tutorial to get DeepStyle working) but some programs run at a higher level and you can just run them as text files. These &quot;scripting languages&quot; tend to be easier to work with.\u003C\u002Fp>\n",{},{"name":81,"clientId":162,"parentClientId":83,"renderedHtml":163,"attributes":164},"6a8e6ccf1f871","\n\u003Cp class=\"wp-block-paragraph\">So \u003Ccode>torch\u003C\u002Fcode> is calling the \u003Ccode>neural_style\u003C\u002Fcode> lua script. But you need to tell it what you specifically want to do! This can be done with flags. Flags look like this:\u003C\u002Fp>\n",{},{"name":125,"clientId":166,"parentClientId":83,"renderedHtml":167,"attributes":168},"6a8e6ccf1f872","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-gpu 0\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":170,"parentClientId":83,"renderedHtml":171,"attributes":172},"6a8e6ccf1f873","\n\u003Cp class=\"wp-block-paragraph\">or this:\u003C\u002Fp>\n",{},{"name":125,"clientId":174,"parentClientId":83,"renderedHtml":175,"attributes":176},"6a8e6ccf1f874","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-print_iter 1\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":178,"parentClientId":83,"renderedHtml":171,"attributes":179},"6a8e6ccf1f875",{},{"name":125,"clientId":181,"parentClientId":83,"renderedHtml":182,"attributes":183},"6a8e6ccf1f876","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-this_aint_a_real_flag true\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":185,"parentClientId":83,"renderedHtml":186,"attributes":187},"6a8e6ccf1f877","\n\u003Cp class=\"wp-block-paragraph\">Basically it’s going to be \u003Ccode>-something\u003C\u002Fcode> with a dash next to it that names the setting being used followed by what the setting is being set to. Pretty simple right?\u003C\u002Fp>\n",{},{"name":116,"clientId":189,"parentClientId":83,"renderedHtml":190,"attributes":191},"6a8e6ccf1f878","\n\u003Ch4 class=\"wp-block-heading\">My Recommended Command\u003C\u002Fh4>\n",{},{"name":81,"clientId":193,"parentClientId":83,"renderedHtml":194,"attributes":195},"6a8e6ccf1f879","\n\u003Cp class=\"wp-block-paragraph\">Here’s a pretty standard command you can run:\u003C\u002Fp>\n",{},{"name":125,"clientId":197,"parentClientId":83,"renderedHtml":198,"attributes":199},"6a8e6ccf1f87a","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>th neural_style.lua -save_iter 400 -image_size 512 -style_image library\u002Fvan-gogh.jpg -content_image library\u002Fpicture-of-me.jpg -num_iterations 1200 -gpu 0 -output_image library\u002Foutput\u002Fpicture-of-me\u002Fvan-gogh-picture-of-me.png\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":201,"parentClientId":83,"renderedHtml":202,"attributes":203},"6a8e6ccf1f87b","\n\u003Cp class=\"wp-block-paragraph\">And now I’ll explain each of the flags.\u003C\u002Fp>\n",{},{"name":125,"clientId":205,"parentClientId":83,"renderedHtml":206,"attributes":207},"6a8e6ccf1f87c","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-save_iter 400\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":209,"parentClientId":83,"renderedHtml":210,"attributes":211},"6a8e6ccf1f87d","\n\u003Cp class=\"wp-block-paragraph\">This means that the neural network should save out a progress picture every 400 iterations. Neural networks that transform imagery in this way do so over iterations. I recommend you read \u003Ca href=\"https:\u002F\u002Fwww.jackalope.tech\u002Fhow-artists-can-use-neural-networks-to-make-art\u002F?ref=hackernoon.com\">my very first neural network and art article\u003C\u002Fa> (which is not a tutorial) which goes over some of the conceptual background of neural networks and links to some resources that might help stuff make sense. With the above setting I’m having it save a progress pic every 400 iterations but you could do more if you wanted to make something animating into the style which can be pretty cool in my experience.\u003C\u002Fp>\n",{},{"name":107,"clientId":213,"parentClientId":83,"renderedHtml":214,"attributes":215},"6a8e6ccf1f87e","\n\u003Cfigure class=\"wp-block-image size-full\">\u003Cimg src=\"https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0p9pGOfe-CSCewCZa.gif\" alt=\"Aslan French&#039;s image-328ac8\" class=\"wp-image-586\"\u002F>\u003C\u002Ffigure>\n",{},{"name":125,"clientId":217,"parentClientId":83,"renderedHtml":218,"attributes":219},"6a8e6ccf1f87f","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-image_size 512\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":221,"parentClientId":83,"renderedHtml":222,"attributes":223},"6a8e6ccf1f880","\n\u003Cp class=\"wp-block-paragraph\">The above is where I specify the output image size. I have a 970 gpu on my desktop and 512 is about the biggest I can reliably output. You might be able to do more, but it will be hard even with a more powerful machine because as the size scales, it does not do so linearly but exponentially. In other words, you double the size of the image, you quadruple the size of the firepower needed. Because it’s not just increasing the width but also the length.\u003C\u002Fp>\n",{},{"name":125,"clientId":225,"parentClientId":83,"renderedHtml":226,"attributes":227},"6a8e6ccf1f881","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-style_image library\u002Fvan-gogh.jpg\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":229,"parentClientId":83,"renderedHtml":230,"attributes":231},"6a8e6ccf1f882","\n\u003Cp class=\"wp-block-paragraph\">This flag tells DeepStyle which image to use as your style image reference. (again, refer to the first article to get the terminology of style versus content image down). In this case I have created a folder in the neural-style folder named library and I have saved a van-gogh painting there as a jpeg.\u003C\u002Fp>\n",{},{"name":107,"clientId":233,"parentClientId":83,"renderedHtml":234,"attributes":235},"6a8e6ccf1f883","\n\u003Cfigure class=\"wp-block-image size-full\">\u003Cimg src=\"https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0n4X_KFgWQT07FyQU.gif\" alt=\"Aslan French&#039;s image-8884\" class=\"wp-image-587\"\u002F>\u003C\u002Ffigure>\n",{},{"name":125,"clientId":237,"parentClientId":83,"renderedHtml":238,"attributes":239},"6a8e6ccf1f884","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-content_image library\u002Fpicture-of-me.jpg\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":241,"parentClientId":83,"renderedHtml":242,"attributes":243},"6a8e6ccf1f885","\n\u003Cp class=\"wp-block-paragraph\">That’s setting the content image. I also put it in the library folder. I like to keep all my style, content, and output images in a separate folder from the neural network files so that I don’t get things super messy as I’m working. (and actually now that I have my desktop set up as a personal cloud server, I have it automatically output stuff to a cloud folder where it gets downloaded on to my laptop where I do the actual painting in Photoshop etc).\u003C\u002Fp>\n",{},{"name":125,"clientId":245,"parentClientId":83,"renderedHtml":246,"attributes":247},"6a8e6ccf1f886","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-num_iterations 1200\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":249,"parentClientId":83,"renderedHtml":250,"attributes":251},"6a8e6ccf1f887","\n\u003Cp class=\"wp-block-paragraph\">This tells DeepStyle the total Number of iterations I want to make. Hypothetically the more iterations that you make the more similar you can make the content image to the style image, but I find that it’s basically diminishing returns past 1200.\u003C\u002Fp>\n",{},{"name":125,"clientId":253,"parentClientId":83,"renderedHtml":167,"attributes":254},"6a8e6ccf1f888",{},{"name":81,"clientId":256,"parentClientId":83,"renderedHtml":257,"attributes":258},"6a8e6ccf1f889","\n\u003Cp class=\"wp-block-paragraph\">This tells DeepStyle to use the gpu.\u003C\u002Fp>\n",{},{"name":125,"clientId":260,"parentClientId":83,"renderedHtml":261,"attributes":262},"6a8e6ccf1f88a","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>-output_image library\u002Foutput\u002Fpicture-of-me\u002Fvan-gogh-picture-of-me.png\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":264,"parentClientId":83,"renderedHtml":265,"attributes":266},"6a8e6ccf1f88b","\n\u003Cp class=\"wp-block-paragraph\">The final piece! This tells DeepStyle where to output the image. In this case I am having it create a folder inside of library called “output” and then I’m having it create a folder named for the content image used, and then I’m giving it a name which contains both the name of the content image and the style image. I think it’s a good idea to do this because once you start batch processing this stuff you’re going to get A WHOLE LOTTA outputs and it’s going to be had to keep them all organized.\u003C\u002Fp>\n",{},{"name":81,"clientId":268,"parentClientId":83,"renderedHtml":269,"attributes":270},"6a8e6ccf1f88c","\n\u003Cp class=\"wp-block-paragraph\">So that’s the basic breakdown of the standard script. But the great thing about code is it’s really good at doing repetitive stuff over and over again, so even though we could copy and paste this over and over again, and change the name of the images and outputs each time, we don’t have to! I made a script for it!\u003C\u002Fp>\n",{},{"name":116,"clientId":272,"parentClientId":83,"renderedHtml":273,"attributes":274},"6a8e6ccf1f88d","\n\u003Ch3 class=\"wp-block-heading\">\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fjcklpe\u002FNeuralArtTutorial\u002Fblob\u002Fmaster\u002Fdeep-style-batch.sh?ref=hackernoon.com\">\u003Cstrong>Get it Here\u003C\u002Fstrong>\u003C\u002Fa>\u003C\u002Fh3>\n",{},{"name":116,"clientId":276,"parentClientId":83,"renderedHtml":277,"attributes":278},"6a8e6ccf1f88e","\n\u003Ch4 class=\"wp-block-heading\">Automate it!\u003C\u002Fh4>\n",{},{"name":81,"clientId":280,"parentClientId":83,"renderedHtml":281,"attributes":282},"6a8e6ccf1f88f","\n\u003Cp class=\"wp-block-paragraph\">Here’s what that code looks like:\u003C\u002Fp>\n",{},{"name":125,"clientId":284,"parentClientId":83,"renderedHtml":285,"attributes":286},"6a8e6ccf1f890","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>function neural_fusion() {th neural_style.lua -save_iter 400 -image_size 512 -style_image library\u002F$1.jpg -content_image library\u002F$content.jpg -num_iterations 1200 -gpu 0 -output_image library\u002Foutput\u002F$content\u002F$content-$1.png};content=mantis;mkdir library\u002Foutput\u002F$content;neural_fusion zebrasmoothie;neural_fusion wolfhowl;neural_fusion wood;\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":288,"parentClientId":83,"renderedHtml":289,"attributes":290},"6a8e6ccf1f891","\n\u003Cp class=\"wp-block-paragraph\">So here’s what that code means. First I make a function. A function is just a piece of code that stores a series of actions. It’s kinda like a magic spell that I write down on a scroll so that I don’t have to remember all the complicated words every time I want to use it. This is the function:\u003C\u002Fp>\n",{},{"name":125,"clientId":292,"parentClientId":83,"renderedHtml":293,"attributes":294},"6a8e6ccf1f892","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>function neural_fusion() {th neural_style.lua -save_iter 400 -image_size 512 -style_image library\u002F$1.jpg -content_image library\u002F$content.jpg -num_iterations 1200 -gpu 0 -output_image library\u002Foutput\u002F$content\u002F$content-$1.png};\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":296,"parentClientId":83,"renderedHtml":297,"attributes":298},"6a8e6ccf1f893","\n\u003Cp class=\"wp-block-paragraph\">You can see it contains the command with flags to run DeepStyle. It also has some funny things with dollar signs too. Those are variables. Variables are like functions but even simpler. You probably know them from math class. X+Y=250 and then you have to figure out what X is right? X and Y are just stand ins for other numbers, or in this case for words.\u003C\u002Fp>\n",{},{"name":125,"clientId":300,"parentClientId":83,"renderedHtml":301,"attributes":302},"6a8e6ccf1f894","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>content=mantis;\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":304,"parentClientId":83,"renderedHtml":305,"attributes":306},"6a8e6ccf1f895","\n\u003Cp class=\"wp-block-paragraph\">Here I’m setting the variable \u003Ccode>$content\u003C\u002Fcode> to equal mantis. As you can see, \u003Ccode>$content\u003C\u002Fcode> is used as the name of the content image. So I have a image in library called \u003Ccode>&quot;mantis.jpg&quot;\u003C\u002Fcode>.\u003C\u002Fp>\n",{},{"name":125,"clientId":308,"parentClientId":83,"renderedHtml":309,"attributes":310},"6a8e6ccf1f896","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>mkdir library\u002Foutput\u002F$content;\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":312,"parentClientId":83,"renderedHtml":313,"attributes":314},"6a8e6ccf1f897","\n\u003Cp class=\"wp-block-paragraph\">Here, I’m making a new directory inside my output folder called “mantis” in order to put my mantis content image outputs. Keep things tidy!\u003C\u002Fp>\n",{},{"name":125,"clientId":316,"parentClientId":83,"renderedHtml":317,"attributes":318},"6a8e6ccf1f898","\n\u003Cpre class=\"wp-block-code\">\u003Ccode>neural_fusion zebrasmoothie;neural_fusion wolfhowl;neural_fusion wood;\u003C\u002Fcode>\u003C\u002Fpre>\n",{},{"name":81,"clientId":320,"parentClientId":83,"renderedHtml":321,"attributes":322},"6a8e6ccf1f899","\n\u003Cp class=\"wp-block-paragraph\">And here is where I’m actually running DeepStyle. Each line is me calling the neural_fusion function I made and giving it a variable to attach to the style image which in the function is represented as $1. I don’t have to declare this function the way I did with mantis and content because it’s going to vary between each run of the function.\u003C\u002Fp>\n",{},{"name":81,"clientId":324,"parentClientId":83,"renderedHtml":325,"attributes":326},"6a8e6ccf1f89a","\n\u003Cp class=\"wp-block-paragraph\">And that’s basically it! You can just run a bunch of these and get a HUGE number of images.\u003C\u002Fp>\n",{},{"name":116,"clientId":328,"parentClientId":83,"renderedHtml":329,"attributes":330},"6a8e6ccf1f89b","\n\u003Ch4 class=\"wp-block-heading\">Make them bigger!\u003C\u002Fh4>\n",{},{"name":81,"clientId":332,"parentClientId":83,"renderedHtml":333,"attributes":334},"6a8e6ccf1f89c","\n\u003Cp class=\"wp-block-paragraph\">You need to make those image resolutions bigger if you want to use them to paint, right? But… how could you make an image bigger? I mean you can make images bigger but then they get all pixelated…. right?\u003C\u002Fp>\n",{},{"name":107,"clientId":336,"parentClientId":83,"renderedHtml":337,"attributes":338},"6a8e6ccf1f89d","\n\u003Cfigure class=\"wp-block-image size-full\">\u003Cimg src=\"https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0uEIP1UUuBJ3jjpEJ-scaled.jpg\" alt=\"Aslan French&#039;s image-462b2\" class=\"wp-image-588\"\u002F>\u003C\u002Ffigure>\n",{},{"name":81,"clientId":340,"parentClientId":83,"renderedHtml":341,"attributes":342},"6a8e6ccf1f89e","\n\u003Cp class=\"wp-block-paragraph\">Well, that’s where neural network magic comes in again. We’re going to use a neural network called “Waifu2X”. Waifu is japanese nerd slang for wife. But it’s a particular kind of wife. It’s…. well it’s an anime wife. It’s like… a wife you have who is animated. Basically it’s just a way a Japanese nerd says they really like a particular character…. uh… look I’m not going to explain it to you. You can look it up.\u003C\u002Fp>\n",{},{"name":81,"clientId":344,"parentClientId":83,"renderedHtml":345,"attributes":346},"6a8e6ccf1f89f","\n\u003Cp class=\"wp-block-paragraph\">Point is! Some people like anime a lot. They like it so much they trained a neural network to \u003Cstrong>MAKE BIGGER ANIME!\u003C\u002Fstrong>\u003C\u002Fp>\n",{},{"name":81,"clientId":348,"parentClientId":83,"renderedHtml":349,"attributes":350},"6a8e6ccf1f8a0","\n\u003Cp class=\"wp-block-paragraph\">(also don’t look up “big anime” on google image search right after looking up waifu.)\u003C\u002Fp>\n",{},{"name":81,"clientId":352,"parentClientId":83,"renderedHtml":353,"attributes":354},"6a8e6ccf1f8a1","\n\u003Cp class=\"wp-block-paragraph\">That’s what Waifu 2x is. It’s a neural network that was trained on thousands of frames of anime at 1080p and at 4k resolutions so that you can give it a 1080p image and it will make it 4k. OR you can just give it any size image and it will make it bigger. The smaller the starting picture, the less info for it go off of, but it’s pretty impressive all things considered! I’m surprised that Adobe hasn’t already tried packaging this into Photoshop. Probably because this neural network has the potential to completely destroy the stock photo industry which they’ve been trying to get into but… you know…\u003C\u002Fp>\n",{},{"name":81,"clientId":356,"parentClientId":83,"renderedHtml":357,"attributes":358},"6a8e6ccf1f8a2","\n\u003Cp class=\"wp-block-paragraph\">Anyway I’m not going to go as in detail on this one because it’s easy to install on Windows, and it uses a GUI, so most of it is pretty self explanatory.\u003C\u002Fp>\n",{},{"name":81,"clientId":360,"parentClientId":83,"renderedHtml":361,"attributes":362},"6a8e6ccf1f8a3","\n\u003Cp class=\"wp-block-paragraph\">Basically you just gotta download from \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Flltcggie\u002Fwaifu2x-caffe\u002Freleases\u002Fdownload\u002F1.2.0.1\u002Fwaifu2x-caffe.zip?ref=hackernoon.com\">here\u003C\u002Fa>.\u003C\u002Fp>\n",{},{"name":81,"clientId":364,"parentClientId":83,"renderedHtml":365,"attributes":366},"6a8e6ccf1f8a4","\n\u003Cp class=\"wp-block-paragraph\">Unzip it. And then you just open up the folder and click on the.exe file and the GUI will open up:\u003C\u002Fp>\n",{},{"name":107,"clientId":368,"parentClientId":83,"renderedHtml":369,"attributes":370},"6a8e6ccf1f8a5","\n\u003Cfigure class=\"wp-block-image size-full\">\u003Cimg src=\"https:\u002F\u002Fwww.aslanfrench.work\u002Fmedia\u002F2026\u002F05\u002F0W5mqCoDpqHkwv3xc.jpg\" alt=\"Aslan French&#039;s image-5b359\" class=\"wp-image-589\"\u002F>\u003C\u002Ffigure>\n",{},{"name":81,"clientId":372,"parentClientId":83,"renderedHtml":373,"attributes":374},"6a8e6ccf1f8a6","\n\u003Cp class=\"wp-block-paragraph\">Select your input path, select the output path, and then set the magnification size. 2.00 means it will be twice as big. 4.00 means 4 times as big. Pretty basic stuff. Denoising can be helpful, though it can also wash out a lot of the texture that the style image imparts, and it can lead to a sort of uniform “plasticky” look. The rest of the settings you don’t really need to mess with. You select a folder as the input path to have a big batch set of images made. It’s all pretty simple.\u003C\u002Fp>\n",{},{"name":81,"clientId":376,"parentClientId":83,"renderedHtml":377,"attributes":378},"6a8e6ccf1f8a7","\n\u003Cp class=\"wp-block-paragraph\">NEXT WEEK IS THE FINAL PART!\u003C\u002Fp>\n",{},{"name":81,"clientId":380,"parentClientId":83,"renderedHtml":381,"attributes":382},"6a8e6ccf1f8a8","\n\u003Cp class=\"wp-block-paragraph\">(but not the final article on this subject. I’ve got lots more coming, so subscribe to my \u003Ca href=\"https:\u002F\u002Fwww.jackalope.tech\u002Ffeed\u002F?ref=hackernoon.com\">RSS\u003C\u002Fa>, or \u003Ca href=\"https:\u002F\u002Fmailchi.mp\u002Ff75162f1141a\u002Fdesign-x-code_newsletter?ref=hackernoon.com\">newsletter\u003C\u002Fa>, or \u003Ca href=\"https:\u002F\u002Fmailchi.mp\u002Ff75162f1141a\u002Fdesign-x-code_newsletter?ref=hackernoon.com\">facebook page\u003C\u002Fa>. And as always, if you have any questions or comments, please be sure to reach out. Getting “fanmail” after my absence was one of the things that encouraged me to keep it up and come back to finish the series out. I didn’t want to let ya’ll down! )\u003C\u002Fp>\n",{},{"name":81,"clientId":384,"parentClientId":83,"renderedHtml":385,"attributes":386},"6a8e6ccf1f8a9","\n\u003Cp class=\"wp-block-paragraph\">_Originally published at_\u003Ca href=\"https:\u002F\u002Fwww.jackalope.tech\u002Fneural-networks-for-artists-tutorial\u002F?ref=hackernoon.com\">_Jackalope.tech_\u003C\u002Fa>_._\u003C\u002Fp>\n",{},"\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>cd ~\u002Fneural-style\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>th neural_style.lua -gpu 0 -print_iter 1\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>th\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>neural_style.lua\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-gpu 0\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-print_iter 1\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-this_aint_a_real_flag true\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>th neural_style.lua -save_iter 400 -image_size 512 -style_image library\u002Fvan-gogh.jpg -content_image library\u002Fpicture-of-me.jpg -num_iterations 1200 -gpu 0 -output_image library\u002Foutput\u002Fpicture-of-me\u002Fvan-gogh-picture-of-me.png\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-save_iter 400\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-image_size 512\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-style_image library\u002Fvan-gogh.jpg\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-content_image library\u002Fpicture-of-me.jpg\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-num_iterations 1200\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>-output_image library\u002Foutput\u002Fpicture-of-me\u002Fvan-gogh-picture-of-me.png\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>function neural_fusion() {th neural_style.lua -save_iter 400 -image_size 512 -style_image library\u002F$1.jpg -content_image library\u002F$content.jpg -num_iterations 1200 -gpu 0 -output_image library\u002Foutput\u002F$content\u002F$content-$1.png};content=mantis;mkdir library\u002Foutput\u002F$content;neural_fusion zebrasmoothie;neural_fusion wolfhowl;neural_fusion wood;\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>function neural_fusion() {th neural_style.lua -save_iter 400 -image_size 512 -style_image library\u002F$1.jpg -content_image library\u002F$content.jpg -num_iterations 1200 -gpu 0 -output_image library\u002Foutput\u002F$content\u002F$content-$1.png};\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>content=mantis;\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>mkdir library\u002Foutput\u002F$content;\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki midnight\" style=\"background-color:#0818a0;color:#e0eaff\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>neural_fusion zebrasmoothie;neural_fusion wolfhowl;neural_fusion wood;\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>",1787718861265]