Search or Generate Sprite Images Using AI
-
In the previous tutorial, you learned how to search AI-generated backdrops or generate your own. In this tutorial, you can follow some simple steps to learn a similar but more powerful tool for generating sprite costumes.
Note that strong moderation is applied to ensure all the images are appropriate for K-12 students. If any user tries to generate an inappropriate image, the request will be rejected. Please use this powerful tool responsibly. In addition, CreatiCode has the right to remove any inappropriate image from the library without the creator’s approval.
Step 1 - Open the AI Image Library Window
To get started, hover the mouse pointer over the circular button at the bottom right of the playground for adding sprites, and then select the “AI” option:
Step 2 - Search for a sprite image from the community
Before generating a new sprite costume, you should first search among the existing sprite images generated by the community. This is much faster than generating new images by yourself.
Note that there are 2 different models for generating sprites:
- Human: this option should be selected when searching or generating human-like characters, or any character with hands/legs/eys/mouth etc.
- Non-Human: this option should be selected for all other types of objects, such as chairs, cars, animals, etc.
For example, you can input “a boy in blue shirt” into the text box, select the “Human” option, then click the “Search” button. The system will display some existing sprite images that are most related to “a boy in blue shirt”. You can then click on any one of them to add it to your project:
For another example, you can search for “a red car”, and make sure to select “Non-Human”:
You might notice that some of the images are not for cars, such as the “red fox”. This is because the “Search” button will search images by their descriptions, so the red fox is treated as somewhat related to the red car, as they are both red. Of course, the true red cars are ranked higher in the result list.
Step 3 - Refine Your Query
When there are many related images, you can refine your query to narrow down the list. For example, when we search for “a boy in blue shirt”, several images are for boys with golden hair. If we add “black hair” to our query, then the top results are all for boys with blue shirt and black hair:
Step 4 - Search by Name
As explained above, the “Search” button searches by the description of the images. For example, when we search for “a boy in blue shirt” earlier, the result images may have different names.
Another way to search is to try to match the image name with keywords directly. This is especially useful if you already know the name of the image you are looking for. For example, if you only want images with names that contain “captain hook”, you can do so using the “Search by Name” button:
Step 5 - Generate Your Own Sprite
If you can’t find the sprite you need, you can use the “Generate” button to create a new sprite. There are 2 models to choose from:
- Model1 is faster and it understands your description better. However, you can not generate variations of images from Model1 (see “Advanced Topic 2” below).
- Model2 is slower and it may misunderstand your description sometimes. Also, you can use images from Model2 as reference to generate its variations.
Note that it is critical that you give a detailed description of the sprite, and don’t just use one or two words.For example, suppose you need a boy in blue shirt that’s waving a hand, you may not find it in the existing library. You can set the description as “a boy, blue shirt, waving hand to viewer”, then click the “Generate” button. You won’t need to specify “Human” or “Non-human”, as our model will determine its type based on your description. After some waiting, the new sprite will be displayed:
For another example, suppose we need a red car for a new game project, but none of the existing red cars are horizontal, then we can generate a new one using this description: “a red car, facing right, game icon”:
Note that you can provide more details in your description, and our AI model will try to incorporate all of them into the image. For example, here is a more detailed description for the boy: a boy in blue shirt, yellow jeans, black shoes, short hair, south asian, dark skin. Here is the result:
Step 6 - Search for Images Generated by You
Since all your generations are shared with the community, you can search for images generated by you in the same way:
However, if you are only looking for images generated by you, you can select the “Created by me” option, and only your images will be searched:
Step 7 - Regenerate Your Images
If you are not happy with an image you have generated, you can generate another image using a different description, or you can simply “regenerate” this image: the same description will be used, but a different random “seed” will be used, so the new image will be different. This is most useful when you believe your description is fine but the AI model is not working well.
For example, an image is generated for “a small school bus”, but the result is not great. As shown below, when you click “regenerate” and confirm, the existing image will be deleted. After some time, you can search for your images again, and you will find the newly generated image:
Step 8 - Refine Your Image Description
Although the current sprite generation models can already generate beautiful and interesting images, they are still far from perfect. They sometimes fail to understand the request or miss critical details. Therefore, we often have to refine our description and regenerate the image multiple times.
Below are some useful tips on how to make the sprite AI model understand our descriptions better:
-
Use a few short phrases: our current image generation models can not understand complex sentences well, and they are mostly trained with requests composed of short keywords. For example, instead of saying “draw a boy wearing a blue shirt, who is waving a hand to us”, a better format is “a boy, blue shirt, waving hand to viewer”.
-
Use parentheses to emphasize key phrases: When there are certain requirements that you want to emphasize, you can wrap them using ( ). For example, suppose you are using this description: “a boy, blue shirt, waving a hand to viewer”. However, the generated images often fail to make the boy wave a hand. Then you can add a pair of ( ) like this: “a boy, blue shirt, (waving a hand to viewer)”. You can even add multiple nested ( ) like this to assign more weight to the phrase: “a boy, blue shirt, (((waving a hand to viewer)))”.
-
Learn from examples: When you find any image you like from the community library, you can find out what description was used to generate that image when you hover the mouse pointer over the name of that image. Over time, you will find out which keywords can be used to achieve a certain result:
Step 9 - Delete Your Image
If you are not happy with an image you have generated, you can also delete it from the library:
Step 10 - Check Image Generation Request Status
Unlike generating backdrop images, the process of generating sprite images is much slower, and there are also many more requests. Therefore, your request may be queued behind other users’ requests. In addition, sometimes, the image generated may have issues and be removed. For example, it might be inappropriate, or it might be blurry or malformed.
Therefore, to find out the progress of your requests, you can click the “Request Status” button, which will display a list of the most recent requests from you. You can review their description, image name, creation time and current status. In addition, if you want to cancel a queued request, you can click the “cancel” button:
Subscription vs Free Accounts
The AI-based sprite generation tool is freely available to all users. However, for users with a subscription, there are some advantages:
- The premium users have a much shorter waiting time when there are many requests in the queue.
- In times of high demand, free users may be subject to a rate limit on how many images they can generate every hour.
Advanced Topic 1 - Different Generation Styles
So far, you have learned the basic operations to work with AI-generated sprites. One additional technique you might want to explore is to specify different styles when you generate an image.
By default, a 2D cartoon-like style will be used to generate the backdrop. However, you can specify any other style in your description. There are tons of interesting styles, and below are some interesting examples you can try:
- 2D Flat Drawing
Description: a blue airplane, 2D flat drawing
Description: a princess in a pink dress, looking at viewer, 2D flat drawing
- Anime Style
Description: a blue airplane, anime style
Description: a princess in a pink dress, looking at viewer, anime style
- Stylized Cartoon Drawing
Description: a blue airplane, stylized cartoon drawing
Description: a princess in a pink dress, looking at viewer, stylized cartoon drawing
- 3D Cartoon Style
Description: a blue airplane, 3D cartoon style
Description: a princess in a pink dress, looking at viewer, 3D cartoon style
- Minecraft Style
Description: a blue airplane, Minecraft style
Description: a princess in a pink dress, looking at viewer, square head, Minecraft game character
- Low Poly Style
Description: a blue airplane, low poly style
Description: a princess in a pink dress, looking at viewer, low poly style
- Play-doh Style
Description: a blue airplane, play-doh style
Description: a princess in a pink dress, looking at viewer, play-doh style
- Film Photography
Description: a blue airplane, Kodak Portra 400, film photography
Description: a princess in a pink dress, looking at viewer, Kodak Portra 400, film photography
- Comic Book Style
Description: a blue airplane, comic book style
Description: a princess in a pink dress, looking at viewer, comic book style
- Retro Game Style
Description: a blue airplane, retro-game style
Description: a princess in a pink dress, looking at viewer, retro-game style
- Steampunk Style
Description: a blue airplane, steampunk style
Description: a princess in a pink dress, looking at viewer, steampunk style
Advanced Topic 2 - Animation Using Variations
In Scratch, the same sprite may have multiple costumes, which allows us to create animations. This can be achieved by creating “variations” of an existing image. The idea is to select an existing image as a “reference”, and then ask the AI tool to generate a new image by modifying this reference image.
To use this feature, search for an image you would like to modify, and check the checkbox under it that says “use as reference”. After this, a new button for “Generate Variation” will appear:
After that, describe how you would like to modify this image, such as “make the boy do thumb up”, and then press the “Generate Variation” button:
After a while, the newly generated image will appear, with the requested change:
For another example, here is a bottle of green potion that can serve as the reference:
We can describe the change as “change the potion color to purple”, then click “Generate Variation”. The result image looks like this:
Note that the new person or object may not look exactly the same as the original one, but they should be very similar. Also, the AI tool may not be able to make the change exactly the way you request. You may need to try multiple times or change how you describe the change.
Advanced Topic 3 - Weapons as Game Assets
By default, you can not create any image that is related to violence. For example, if you try to generate an image of a tank, you will get an error message like this:
However, we often need weapon sprites in games, such as tanks or swords. Therefore, one exception is made if you include the keyword game asset in your request. For example, if your request is “a tank, game asset”, then it will not be rejected by the reviewing process:
Note that you should only use such images in game projects. If they are used in any other projects related to violence, that project will be removed, and your account may be banned. -
info-creaticode
-
This was helpful, thank you.
-