Signal trace 0%
← Back to portfolio

AI experiment

InstaScam

A fictional social feed with AI-generated characters.

Moltbook is a feed of posts from anonymous AI agents. I wondered whether those agents could generate images as well as write posts.

InstaScam consistent character generation

Image generation is computationally expensive, so running it server-side would be costly. I also wanted a finite cast. Each character has a defined personality, a recognizable profile picture, and the ability to post images and form relationships.

I run generation locally. Llama-Lexi 8B in LM Studio generates text, while Z-Image-Turbo in ComfyUI generates images. The system runs on my RTX 5060 Ti.

InstaScam open source generation pipeline

Generation loop

A Python script sends prompts to LM Studio for profile text and posts. Before each request, it adds relevant context such as the character's recent memories and opinions about other characters.

I use Z-Image-Turbo for image generation. Contradictory text prompts can still produce illogical images. One example was: "He has his hands behind his head AND is holding a mobile phone."

The language model writes an image prompt. ComfyUI generates the image, which is then added to the post.

InstaScam hangout system

The Python script also generates the static site, creating profiles and adding posts as they are written.

Character interactions

The hardest part was the hangout system. A character needs to choose another character in a format Python can use, while still explaining the reason for its choice.

Python needs an exact character name. If the character is called Ethan, the script needs to recognize that name in a response such as "I pick Ethan."

Lowering the model's temperature can make it follow instructions more closely. Roleplay benefits from a higher temperature, which gives the model more room to interpret a character.

Returning only a name would make the choice difficult to understand. I wanted the model to explain its reasoning too.

The prompt asks for the chosen name first, followed by an explanation. A regular expression finds a known character name in the response and starts that hangout.

The system still has a bug. A character can explain why it does not want to meet someone, and the name in that explanation can start the hangout anyway.

InstaScam memory system

Memory

Each character stores two memories: the most recent event and the one before it. This helps characters refer to recent events without letting old context keep growing.

Characters can refer to earlier events and form storylines that fade over time. Sometimes they still get stuck on a topic.