How to change the style of an image using Fooocus (img2img)

In this tutorial, we’ll explore how to transform the style of an image using Fooocus, specifically focusing on the ‘img2img’ feature. Our primary goal is to convert a photo-realistic image into an anime-style illustration. However, this technique isn’t limited to just anime styles; it can be applied to a variety of artistic transformations. Let’s dive in.

Set up

Models

We will be using two models

  • juggernautXL_version6Rundiffusion.safetensors for the source image
  • bluePencilXL_v050.safetensors for the target image

To verify that you have these models, click Advanced checkbox. Then click the Model tab on the right.

Make sure that both models are listed in the Base Model drop down list.

If you don’t see these models, follow the link listed in the Default Models section in the Fooocus project’s README page (https://github.com/lllyasviel/Fooocus) and download the missing models. Put the downloaded models in Fooocus/models/checkpoints directory.

Prompt

We’ll use with the following prompt to generate the source image:

Portrait of a super cute kitten and a puppy on the kitchen counter. The image was taken by a professional photographer using Canon 5d mark iv.

Steps

If you do not have an image that you want to upscale, the first step is to generate an image. If you enter the above prompt and press Generate, you should get an image similar to the one shown at the top of this page. Now do the following:

  • Modify the prompt to drop a part that is related to a photograph: “The image was taken by a professional photographer using Canon 5d mark iv.” This is needed as we don’t want to generate a photo-like image.
  • Check the Input Image checkbox
  • Check the Advanced checkbox below the text prompt
  • Click the Image Prompt tab
  • Check the Advanced checkbox below the text prompt
  • Drag the image from the output folder of Fooocus into the canvas under the Image Prompt tab

After setting the options, the fields should look like below (note that the bottom Advanced checkbox needs to be checked which is not shown):

Make sure that the ImagePrompt radio button is selected at the bottom.

Now, on the right side on the screen, select the Style tab. Enter Anime in the search box. Then select MRE Anime. Uncheck Fooocus Sharp, Fooocus V2 and Fooocus Enhance.

Now, click the Model tab. Select bluePencilXL_v050.safetensors in the Base Model drop down list.

Now press Generate. You should see anime-like images generated.

This is one of the generated images.

Instead of MRE Anime style, you can also try SAI Anime style (the ratio button is located immediately to the left of the MRE Anime style). Here is the result:

A wide array of styles can be found under the ‘Style’ tab in Fooocus. If anime isn’t your desired theme, consider switching to the ‘juggernautXL_version6Rundiffusion.safetensors’ model and explore other style options. You’ll be pleasantly surprised by the ease with which you can generate images in a variety of distinct artistic styles.

Leave a Comment

Your email address will not be published. Required fields are marked *