Skip to main content

Making book covers with Stable Diffusion

I made a short video explaining how to use Stable Diffusion to create ebook and print covers

I used Krita to edit the photos but pretty much any image editor would do, you just need to be able to make selections and erase.

Here are the steps -

Step One

Go to https://huggingface.co/spaces/stabilityai/stable-diffusion

or https://stablediffusionweb.com/#demo

and enter a prompt for the image you want.

For this tutorial, I wanted a space scene so used the following prompts to create four separate images that I would edit together.

"Lunar lander in space realistic"

"Astronaut tabletop miniatures realistic"

"Star field with galaxy realistic" (this gave me two images with prints hanging in a gallery, so maybe try different words)

"Realistic lunar base with stars in background"

Use the guidance scale at the bottom (if available) to tweak the settings.

I normally try to keep it between one and nine but experiment and see what you come up with.

After anything between 30 seconds and a minute, you should get your generated pictures.

If you don't get anything you like, keep trying!

Add more keywords and move the guidance scale until you get something you are happy with.

When you are done just right click or hold the image to download it.

It gave me four separate images, an Astronaut, a Spacecraft, a Lunar Base and a Starfield.

So now let's edit them.

Step Two

Lets take the Astronaut as an example.

I used the "Magic Wand" to select a contiguous colour to erase large sections by clicking on a part of the image that is a different colour to the Astronaut. You can then hold the shift key and click to add to the selection. If you then click "Cut" from the Edit menu, it will remove everything you have selected.

I then chose the Brush (in Krita) and changed its attribute to Erase and simply clicked and dragged over the remaining parts of the image I didn't want. I would use small strokes and release the mouse / pen regularly otherwise if you make a mistake and Undo, it will put everything back!

Use the zoom and change the size of the tooltip to erase fine areas.

You should now have a relatively clean picture of an Astronaut surrounded by a grid denoting transparency.

Save the file through the "Export" menu as a PNG file. This will preserve the transparency.

I then repeated the process with the Spacecraft and Lunar Base pictures.

The Starfield would be the background so depending on the look you want you could resize the image to fit the size of your book cover (this would stretch it) or resize the canvas which will create empty space around your picture. I resized vertically which left me with a blank space beneath which was fine as my Lunar Base would be going there.

Step Three

Now we need to create a single image

I opened the background photo (Starfield) and then in the layers menu chose to "Import as paint layer".

This opened a dialog which allowed me to import the Lunar Base image which appeared in a new layer on top of the Starfield. Then using the "Layer - Transform" tools I could resize if necessary and use the Move tool to place it where it would work best. Sometimes flipping the image horizontally can make the whole piece fit together.

I repeated the process with the Spacecraft and Astronaut, moving and resizing as required.

Finally I used the paint tool to draw a faint rocket exhaust and the text tool to put the author and book name.

Export the final image as a jpeg and you are done.

The final image will be small so you may need to resize it to make it bigger which means you will lose some quality. Using a paid service like Dreamstudio or DallE will allow you to create bigger images.

Congratulations, you now have a cover to use in a print book or ebook.



Comments

Popular posts from this blog

Writing How to write an Adventure Gamebook

 Uploaded a video about writing 'How to write an adventure gamebook'. Buoyed with confidence after finishing Monstrous Manor, I decided to try to create a useful guide to writing an adventure gamebook. I was and still am clearly no expert in the field but I felt I could gather together lots of useful information into one place to give a useful overview of the process from initial gestation to published book. I had also developed a short lived but rabid interest in AI and wanted to explore its possibilities. To that end, I used Dreamstudio and other AI image generators to create characters and backgrounds for the cover and internal decoration. I experimented with ChatGPT to try to create a gamebook which I quickly discovered was way beyond its capabilities. Nonetheless I expanded some of the passages it produced to create a small gamebook adventure which I included both to illustrate potential AI capabilities and as a bit of fun for the reader. Overall I think I managed to give ...

Writing Attack of the Zombie Vampires

 Uploaded a video about writing Attack of the Zombie Vampires The original inspiration for attack of the zombie vampires or zompires came years ago when I had an idea for a series of short films. They were a parody of a Van Helsing type character who would disguise himself as a typical victim and after defeating the monster loudly proclaim 'the menace has been defeated'. I can remember wanting to call one of them 'the phantom menace' and having a chuckle about the thought of someone clicking on the video and instead of enjoying a George Lucas epic they would see this strange little movie instead. Yes, I have a pretty weird sense of humour. I never made the films but the idea of the character stuck and after having various discussions about what a vampire / zombie hybrid might be like, I had the seed of what became 'Attack of the zombie vampires'. It was always going to be slightly comedic because it just sounds like some trashy straight to video flick from the 1...

Writing The Enchanted Ones

 Uploaded a video about writing The Enchanted Ones The basic concept of this story came together a long time ago but it wasn't until other elements fell into place that I felt I was ready to write it. I've always been interested in werewolves and shapeshifters but the two things which formed the central idea were, what if an animal turned into a human every night? and what if that animal was a unicorn. The pieces slowly started to fall into place like a white witch being cursed to age quickly unless she was in close proximity to a unicorn and the enchantment of the unicorn so that it became human in the evenings, allowing them to spend time together. I needed a protagonist so created a back story with a wicked sister who starts the whole plot rolling and returns to cause mischief. I normally get ideas about horror and sci-fi so it was nice to be able to explore something completely different from that, which I hope to able to do again. Until next time.