[Gemini] How I Created a Gem for Generating Header Images
Hello, this is Shimodan✨
Thank you for opening this article🍀
In my previous article, I wrote about a Gem that generates header images, and this time I have summarized the steps for creating it.
I hope this will be helpful for those who are interested in Gems✨
🤔 Reviewing the purpose of creating this Gem
Ayana and Lise, the characters in my articles.
I want them to be more active, and as part of that, I want to use them in my header images!
However, it is a hassle to create header images with Stable Diffusion every time.
So, the plan is to create a Gem dedicated to image generation and leave it to Nano Banana (which is Gemini's latest image generation feature!)😆
🎨 Preparing reference images
First, I create the reference images to pass to Nano Banana.
I think Nano Banana would generate them well just by describing their appearance, but it's better to have them for consistency!
This time, I generated them using this flow.
Generate a front view with Stable Diffusion
(You can use Nano Banana directly, PixAI, or anything else)Pass the front view to Nano Banana and generate side and back views
(Tell it to "generate a three-view drawing from this image" and have it make them)
That is what I did.
Ayana's hairstyle is asymmetrical, so I needed side views for both left and right, which was a bit difficult lol

For Lise, I thought she would take off her cape indoors, so I made two patterns.
Even though some parts are asymmetrical, I made a three-view drawing, trusting it to handle it well.


When you have Nano Banana fix generated images, they gradually get rougher, right?
I cleaned them up using Stable Diffusion, but that might not be accessible to everyone.
So, let's ask Nano Banana to clean them up too!
If you ask it to "clean up the image," it will redraw it quite nicely.



📝 Solidifying the Custom Instructions
Regarding Input and Output
Input: Creation concept (text like "an illustration of two people talking") + original article if necessary
Output: A chibi-style heading image based on the creation concept
Regarding Generation Rules
The creation concept is the top priority; the original article is supplementary information.
(The goal is to avoid following the article content too strictly.)Do not fix the number of characters or the composition.
(There are patterns where only Ayana or only Lise are generated.)Base it on the chibi character style of the reference image.
(I wanted it to generate chibi characters by default.)Aspect ratio: Since it is a note heading image, set it to 16:9.
Do not include the article title in the image.
Regarding Reference Images
I debated between "passing them in the chat every time" and "storing them in the Knowledge base beforehand," but I chose the latter this time.
Knowledge is a feature like a "dedicated storage room" where you can save images and text inside a Gem.
If you keep images here and tell the custom instructions to reference them by file name, you save the trouble of uploading images every time, and it is very smooth!
I was a little worried about whether the Gem would properly reference the images in the Knowledge base, but I figured I could rethink it if it didn't seem to read them well.
(For now, it seems to be referencing them successfully.)
Just in case, I also added, "If the reference image cannot be loaded, confirm with the user."
Regarding Lise's Outfit Variations
Leaving it to Nano Banana is an option, but I decided to set some basic rules as a guide this time.
Indoor scene → No cape
Outdoor scene → With cape
If there is a specific creation image, prioritize that
*The custom instructions summarized here are placed at the end of the article.
💎 Creating a Gem
I will now input the custom instructions I summarized with Claude into the Gem.
(I am creating this on a Mac, but it should be roughly the same elsewhere...!)
Click the three lines in the top left

Click "Gem"

Scroll down a little and click "+ Create Gem"

Enter the Gem name

Enter the Gem description (this is optional)

Enter the custom instructions
What kind of input? (Text only? Images too?)
What kind of output (generation) do you want?
Reference image file name
How to use the reference image
And so on. The more detailed you write, the less the generation results will fluctuate, but if you pack in too much about composition and imagery, I think you will end up with only similar images.
Let's try and adjust this a few times.
(This time, I will copy and paste the text created in step 2 to proceed.)

Provide reference images
Click the "+" in the bottom right.

Select "Upload files".
If your reference images are saved in Google Drive,
you can also use "Add from Drive" or "Photos".

Once you have entered the required items, click "Save".

Once you have saved the Gem, it's time to test it!
Click "Start chat".

If you have closed the menu, click the three lines in the top left to select and open the Gem you created.

This is what it looks like when you open the Gem.

Let's ask it to generate an image!
For this test, we will use this prompt!
Generate an illustration of Ayana and Lise having a cherry blossom viewing together. From a bird's-eye view, the two are looking up. Ayana is holding a rice ball, and Lise is holding a sandwich.


It read the generation instructions and generated something nice!
Lise is wearing her cape since she's outside, nice job Nano Banana...!
If you try a few times and it doesn't go well, just consult the header image generation Gem directly. If you tell it how you want to improve it, I think it will provide some ideas.
Let's try some other generation tests.
Generate an image of Ayana buried in a mountain of cheese steamed cakes.

Generate an image of Lise holding up the ultimate apple to the heavens. Please express joy while maintaining her usual expressionless face.

Generate an illustration of Ayana on guitar and vocals, and Lise on drums. The two are performing on stage.

🍀 Summary
Looking back, here is what I did to create the Gem:
Prepare reference images (character sheets)
Design the custom instructions (input/output)
Test and adjust
I wrote this about how to create an image generation Gem, but I think you can create various Gems using the same method.
Like a "Gem that drafts note articles"
or a "Gem that thinks of SUNO styles and lyrics"
or a "Gem for brainstorming various Gems" lol
Custom instructions can be used outside of Gemini as well, so try creating a partner to help you with what you "want to do" using Projects in Claude or GPTs in ChatGPT✨
(Though Claude can't generate images...!)
I hope you enjoy it! 😆
Bonus: Here are the custom instructions I used this time
Since this is a file for my own use, it might not work as is...!
If you use it, please rewrite the file names (****.png) and character names.
# Header Image Generator
## Purpose of this Gem
Generate header images for note articles based on the creation image provided by the user.
---
## Basic Flow
1. Receive the "creation image" from the user as text
2. Refer to the article content or theme if necessary
3. Generate an image while maintaining character consistency based on the reference images in the knowledge base
---
## Input/Output
### Input
- **Creation Image** (Required): Text instructions on what kind of picture you want. Composition, characters, scenes, etc. This is the top priority.
- **Article or Theme** (Optional): Refer to this as background information. It serves to supplement the creation image.
### Output
- A header image that follows the creation image
- Output with an aspect ratio of 16:9
- Do not include title text in the image
---
## Character Reference Images
Refer to the following character sheets stored in the knowledge base to maintain consistency in character appearance.
### Ayana Kamimura
- Reference file: `****.png`
### Lyse Fertia
- Without cloak: `****_no_cloak.png`
- With cloak: `****_cloak.png`
**Lyse's outfit usage:**
- Indoor scene → Without cloak (`****_no_cloak.png`)
- Outdoor scene → With cloak (`****_cloak.png`)
- If specified in the creation image, prioritize that
---
## Art Style
Based on the chibi character style of the reference images.
---
## Notes
- Prioritize the instructions in the creation image
- Follow the creation image for the number and combination of characters (Ayana only, Lyse only, both together, any are fine)
- If the reference image cannot be read from the knowledge base, confirm the provision of the image with the user
