#Anime Generator | Open source ShellAgent bot

1 messages · Page 1 of 1 (latest)

odd rose
#

Welcome to the Anime Generator, my first bot created on MyShell using ShellAgent! This bot is powered by DeepSeek R1 and Flux.1-dev. In this post, I’ll give you a brief overview of what the bot does, explain how it works, and maybe share a few beginner tips based on my own experience.

#

What is the Anime Generator?

The Anime Generator is a simple bot designed to craft unique anime concepts. It generates characters, a synopsis, and a poster based on either randomly selected genres or genres you choose yourself.

Here is the link to the bot: https://app.myshell.ai/bot/FbMja2?utm_channel=referral&utm_source=share


How Does the Bot Work?

Here’s a step-by-step breakdown of the process:

Choose Your Mode
You start by selecting one of two modes:

  • Random Mode: The bot picks 1 to 5 genres at random from a predefined list of 40 options.
  • Custom Mode: You input your own genres to personalize the output.

Synopsis Creation
Once the genres are set, the bot uses LLM (DeepSeek R1) to create a basic synopsis for an anime that matches the selected genres.

Character Generation
Next, the LLM designs one or more characters for the anime. The number of characters depends on the genres and the synopsis.

Detailed Synopsis and Title
Using the initial synopsis and character details, the LLM refines the story into a more detailed and in-depth synopsis. It also generates a fitting title for the anime.

Poster Design
Finally, the bot creates a poster. The LLM crafts a detailed image prompt based on the synopsis, genres, and character descriptions. This prompt is then used by Flux to produce the poster image.


In Summary
The Anime Generator takes your genre preferences (or random picks) and turns them into a complete anime concept - characters, story, and artwork included! The process can be visualized in a simple ""flowchart"" (just a quick paint sketch) down below

#

Now, a more detailed guide/tutorial on how the bot works.

In this tutorial, I'll provide a clear and detailed explanation of how the Anime Generator bot works. I'll walk you through the process step by step, focusing on the key components and important decisions. If you have any questions about parts I haven't covered, feel free to ping me.

How does the bot really work?

I'll break down the bot's functionality into clear steps, explaining each part in detail.


Start - Setting the Context Variables

The process begins with the Start block. This is where you define all the variables that will be used dynamically throughout the bot's workflow. These variables are essential because they allow the bot to adapt and change as it runs.

Why is this step important?

In ShellAgent, you must set all variables upfront in the Context window. This is different from Proconfig, where variables can be set later in a state's outputs and still work globally across all states. In ShellAgent, however, variables defined in later states are not automatically treated as global context variables, instead they will count as the specific state variables.

What happens if you skip this step?

If you try to use a variable without defining it in the Context window, you might run into some problems and annoying organizing.

Best practice:

To avoid issues, make sure to define every variable you plan to change or update during the bot's workflow in the Context window at the start. This ensures smooth and error-free execution. You don't have to put all of the variables at the start of creating, after all, you probably don't know half of the variables you are going to use. You could set the variables in the START context in the middle of creating, that's what I did.

#

""Intro"" state

The ""Intro"" is one of two blocks you are forced to have along with "Start"

This state basically acts as an intro message in proconfig mode, which you can't code or add/change any outputs, so the first thing you do is skip it entirely, don't even think about that state.

It wouldn't be as useless if you could set the variable values at the "Start" state, but you can't.

#

Actual intro state - setting the variable values

This is the real intro state, since you can actually do stuff from here. Put the intro message you want and let's set values to our variables.

How to set Context. variables?

  • First, you open the "Outputs" tab and press "+ Add", this will give us an "Untitled" variable. Now press the edit button next to it.

  • Here you can edit the output. Press the button on the right next to the Variable name and press on it, then choose "Select Output"

  • Now press the "Please select variable" and choose the Context. variable you wish to set the value of, I'll choose "temperature" for the example.

  • Now, choose the "Code mode" with the button next to the trash can. After that, you can write the string value (plain text), **PYTHON **expression (in curly braces {{ }}) (right now only python expressions are supported), or number value (also in curly braces {{ }}, otherwise it will be counted as a string)

And done, you just set the variable's value, now do that for all the values you need right now.

#

Outputs for Anime generator

This is what variables are set in the intro state.

  • Deepseek settings

Just the recommended settings for deepseek with randomized addition of a number from 0 to 0.1 to top_a and temperature for more uniqueness.

  • Genre list

The genre list the random genres get picked from. The lists are structured like this:

{{'item1', 'item2', ..., 'itemX'}}

but you can and honestly should use backticks (`) instead of apostrophes ('), since if your list contains words like "you're", "it's" etc. you might accidentally close it.

  • Genre_count

Just chooses a random number 1-5

#

Random mode - Choosing a random value from a list

Here the Context. variable context.genres is set with 1-5 random genres

It uses random.sample to take from "Context.genres_list", the list of genres, "Context.genre_count" amount of variables, a random number 1-5

#

Custom mode - Input a genre

Here the user themselves input their genres, which get set to the Context.genres as well

#

Importance of using Context. variables... Again!

This is where I ran with the problem of not setting the variables in context, and I'll show you the problem so you could understand the importance as well, especially if you plan on creating a similar bot with multiple ways to set the same variable.

If you try to set the same variable in the output in two different states, even if you are using the same name of the variables, you'll run into the following problem.

These two variables with seemingly the same name are completely different. That's a really big problem, since you wouldn't be able to use a single path, you'd create two completely different paths, one using, for example, Custom. variables, and the other using Random. variables

#

Task states

The following states are quite self explanatory and easy, you just create a task that follows your system prompt and user prompt.

It's actually so simple and easy that it all could fit into a single state, but for better understanding and ease of tweaking, I divided the tasks into multiple states.

The only thing I can really show you here is using the previous set temperature, top_p, and penalties.

Just change the value as a "Reference mode" with the button at the right side and choose the corresponding variable from Context.

#

End state

The end state, also pretty simple and straightforward, although it does have a secret function to refresh the Context.genre_count variable with a new number from 1-5, so if you choose to make another random anime, you wouldn't have to go back to another state or the first state to generate the variable.

#

That's about it, I explained most of the things that are more or less complicated in the code. If you have any other questions, feedback, or really anything, let me know!

And of course, here is the open source code for anyone that wishes to learn even more in-depth from this tutorial.

Thank you for reading!

nocturne raft
#

This is a really detailed and kind guide. pepeheadpat
To be honest, I've been struggling with building shell agents no matter how much I study, but I'll refer to this and try to learn from it.
Thank you, Shellbro crush

odd rose
ripe radish
next zenith
#

Great open sourcePS_Anime_Sip