Style Transfer Guide

Style transfer models offer near limitless opportunities for customization. To help you choose the right set of hyperparameters to achieve the best results, we've created this guide with examples from ready-to-use styles and heuristics developed from our own experiments.

Choosing a Style Image

Not all style images are equal. For the best results, pick images that:

  • Have large geometric patterns on the scale of 10% - 33% of the image's width
  • Have bold, contrasting color palletes
  • Have strong edges

If you're looking for inspiration, consider searching Unslash or Flickr for terms like "abstract" or "geometric".

Make sure any images you use have an appropriate license.

Loss Weights

Changing the relative magnitude of each loss weight is the best way to change the aesthetic of your model.

There are four loss terms:

  • style weight: The higher this weight, the more the output images will resemble the style of your style image.
  • content weight: The higher this weight, the more your stylized image will retain the content of the original.
  • total variation weight: The higher this value, the smoother your stylized images will be. This may wash out small textures.
  • stability weight: The higher this value, the more the model will attempt to stabilize videos. This can have the effect of washing out smaller textures.

Below are example configurations for a number of sample style images.

NameStyle ImageOutputContent WeightStyle WeightTotal Variation WeightStability Weight
bicentennial_print1.00.00050.000011000
blue_arrow1.00.00010.000011000
comic1.00.00050.000011000
femmes1.00.0010.000011000
filament1.00.00040.000011000
green_blocks1.00.0010.000011000
head_of_clown1.00.0030.000011000
horses_on_seashore1.00.0030.000011000
kaleidoscope1.00.00050.000011000
lamp_post1.00.00040.000011000
mosaic3.00.0010.000011000
notre_dame1.00.00040.000011000
pink_blue_rhombus1.00.00050.000011000
poppy_field3.00.0030.000011000
ritmo_plastico1.00.0030.000011000
shades1.00.00010.000011000
sketch1.00.00040.000011000
snowflake5.00.0010.000011000
sprinkles1.00.000030.000011000
starry_night1.00.0030.000011000
swirl5.00.0010.000011000
the_scream1.00.0020.000011000
the_trial1.00.0030.000011000
tile1.00.00050.000011000
vector2.00.00010.000011000