Explanation and Example of --sref, --sw Parameters
In AI painting, the --sref
parameter is used for Style Reference. This parameter allows you to reference one or more images and instruct AI painting to generate an image based on the style of the referenced image.
Purpose
The main purpose of the --sref
parameter is to guide AI in shaping the style, tone, or atmosphere of the generated image based on the reference images uploaded. This method is particularly useful when you want the generated image to mimic a specific art style, color scheme, texture, or composition.
Usage
The --sref
parameter can be used in conjunction with other prompts to describe the content you want to generate and specify the style of the reference image.
- Style references only work with prompts containing text - they cannot be used with prompts containing only images.
- The URLs of the reference images must follow the parameter
--sref
- If there are multiple reference images, they can be separated by spaces following the parameter:
--sref URL1 URL2 URL3
- You can also use
--sref random
to apply random styles to your image. --sref
can be used with MJ and Niji Version 6.
Use Cases
- Imitating Art Styles: When you want a generated image to be presented in a specific artistic style (such as oil painting, watercolor, neon style), you can use a style reference image.
- Color or Composition Reference: You can use an image with specific colors or composition style as a reference to generate an image with a similar color atmosphere.
Example of Image Generation
The uploaded reference image is as follows, and the URL after uploading is as follows: http://reserve-mask-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/mask-20241014/52f7c21a62416df694f5b1d712365b67.jpg/1024
Normal image generation without any relation to the reference image:
A cat
Image generation using the reference image (related to the reference image):
A cat --sref http://reserve-mask-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/mask-20241014/52f7c21a62416df694f5b1d712365b67.jpg/1024
Use the --seft parameter and append the uploaded original image afterwards
Adjusting the Weight of the Reference Image
Use the style weight parameter --sw to set the strength of stylization. --sw accepts values from 0 to 1000, with 100 being the default value.
Reference as follows (results of different values as per the image reference):
A cat --sref http://reserve-mask-1256181000.cos.ap-shanghai.myqcloud.com/img/cdn/mask-20241014/52f7c21a62416df694f5b1d712365b67.jpg/1024 --sw 1000
- - Prompts Examples for Various Industries
- - Explanation and Example of v Parameter
- - Explanation and Example of ar Parameter
- - Explanation and Example of s Parameter
- - Explanation and Example of q Parameter
- - Explanation and Example of seed Parameter
- - Explanation and Example of c Parameter
- - Explanation and Example of tile Parameter
- - Explanation and Example of niji Parameter
- - Explanation and Example of no Parameter
- - Explanation and Example of iw Parameter
- - Explanation and Example of --sref, --sw Parameters
- - Explanation and Example of cref, cw Parameters
- - How Beginners Can Generate Satisfactory AI Works Based on Reference Images