Creating animated 2d character GIFs with arty

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@ausbitbank·
0.000 HBD
Creating animated 2d character GIFs with arty
I just integrated a neat new [Pixel art sprite sheet generator](https://huggingface.co/Onodofthenorth/SD_PixelArt_SpriteSheet_Generator) into the [stable-diffusion-discord-bot](github.com/ausbitbank/stable-diffusion-discord-bot) I call **Arty** .

For more info see [Artys introduction post](https://peakd.com/@ausbitbank/our-new-stable-diffusion-discord-bot)

Here's a quick tutorial on how to use it to make your own 2d animated characters.

### First, Generate the sprite sheet

Join [my discord server](https://discord.gg/DSdK9KRJxq), and come to the artspam channel if you haven't yet.

The first step will probably take the longest, depending on how specific your desired subject is it can take some prompt tweaking and generating a few variations to get something you're happy with.

The bot command to use the spritesheet generator is
`!dream SUBJECTHERE PixelartRSS --model pixel-sprites`

Swap out `SUBJECTHERE` for your specific idea, eg `anonymous guy fawkes hoodie`

The `PixelartRSS` is a special keyword that generates sprites walking to the right, you can also swap RSS for LSS/FSS/BSS for left/front/back side sprites.

So for my example I typed this into the #artspam chat room:
`!dream anonymous guy fawkes hoodie PixelartRSS --model pixel-sprites`


![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23vsBdSAkhGvnHvTYxEj9YeoPAsC2z9zDJpoXQwUVm56A8W7Aa3RyUnN4wiv7PDab15ki.png)

### Second, remove the background

For this, we can use the bot again. Simply **reply** to the render result you want with `background` and it will [automagically](https://github.com/danielgatis/rembg/) detect the background and reply with a transparent .png image.

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tRzSzmPP9g857NMrxoVjcvTHiYwTb3xnGCW6K8QFFrijLr3EQcqnPw5fG5RZGyNVGkT.png)

This background-removal tool works with almost any image, and can also be triggered by sending a non-reply message in the channel with just `!background` and attaching the image to the message

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23vhoR3GmNGM7svaXfhQ7BxMnGzo8L7wuxnUQorv73vHZpBent9LT8afoZgEE8XSngrgc.png)

### Third, slice up the sprite sheet into individual frames

The easiest tool I've found for this so far is at [ezgif.com/sprite-cutter](https://ezgif.com/sprite-cutter)
Click your new image with the freshly removed background, then click "open original" to get the full address of the image. Copy it to clipboard

Go to [ezgif.com/sprite-cutter](https://ezgif.com/sprite-cutter) and paste your image address into the image URL box and click Upload

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tbKEGuW1pCzxVJjBFrWjoVHhqYukHk1cMZgivahN5yJTqp9tnAqHXRj1MQSRwXXPVJA.png)

On the next screen,tick the box under **"cutting method"** marked **"by number of columns/rows "**, set it to **4** columns, **1** row with an **output format** of GIF , then hit the CUT button

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/EoAYMb3ypQ6jJvNgrXCPbUrxk1d4kjPewAk9o8X8twnVk4pD6T8DQhHSgeUQ7CjPriQ.png)

### Fourth, create the gif

The previous step will spit out the 4 individual images, at this stage you could download the frames as ZIP for later use in other tools.

For the tutorial we want to click **"Create GIF animation"**

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tRxWjJwRYoqdBd93XDcyARGQ1wiZ2x8mwkroYnSXf16psEp7UQKyizwHNUuNosiT3v8.png)

..bringing you to this screen where I edit the **"delay time"** to 10 , and tick the **"don't stack frames"** box before clicking **"Make a GIF"**

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tGaDSoPQDN5tHApZZQWNtzWkufqNc5jEzarbhEwGgUGK17kL82DQfqxWPn2uQwQi2XV.png)

The next screen looks like this, at this point I click the left **"crop"** button

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tGZbsgJ4M9kJf33ULzmMPih9V2avvsVEUW9a4J4kbZXkzmVSsbxfYHJZpjFiKvK14Wh.png)

Bringing you to this screen where I just drag a box around the character to get rid of that excess height, then click **"Crop image!"**

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tbKBJh8ur6tRwY4cLBXBt7fMTT3cdjogvQP21JHZReYAervjWkfxjNDv28RJkHX3xET.png)

Once cropped we see this screen, and you just click the 💾 **"save"** button on the far right to download your final result

![image.png](https://files.peakd.com/file/peakd-hive/ausbitbank/23tGbnfEfuM1oDaujmEZYhNbjvWNYVBcWdSLMJv7ZQTAfSB8jVryrmihNSWyHQqTjCr22.png)

That's it! Here's the animated gif I ended up with after this process. It takes **less then a minute** after some practice

![ezgif.com-gif-maker(6).gif](https://files.peakd.com/file/peakd-hive/ausbitbank/AJebMy4BvzrRHxMU183HpmGGychkpvJh2MuL6A3TvRSDjH2okw3g3TCkomznDwq.gif)

### Conclusion

This sprite sheet model is a lot harder to customise then the other models installed in arty so far. If you want a very specific result it's going to take some tweaking.

For advanced users chasing extremely specific niche subjects I think you would get the best results by merging [this model](https://huggingface.co/Onodofthenorth/SD_PixelArt_SpriteSheet_Generator) with your own custom model trained on photos of your subject.

It's still far from perfect, but I thought this was too cool not to share!

I'll keep playing around with this and hopefully one day arty will be able to do all of the above in a single command :)

I hope someone finds this useful, I'll try to find time to write some more tutorial posts about all of the other cool features I've added recently

<hr>
This post sends 10% rewards to @hive.fund , 90% to the @ausbit.dev arty GPU upgrade fund
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,