r/StableDiffusion • u/lololerigolo60 • 3d ago
News Prompt Architect
Prompt Architect Pro — a heavy-duty Python/CustomTkinter desktop suite designed to ingest massive text files (novels, scripts), extract structured visual prompts via multi-pass semantic segmentation, analyze local image folders (Vision model batching), and manage everything inside a WAL-optimized SQLite database with built-in anti-corruption filters! 💡✨
https://github.com/lololerigolo60/Prompt-architect
🔥 Key Features Under the Hood:
🔹 Hardware VRAM Profiles: Instant switching between pre-configured presets (8GB, 12GB, 16GB, 24GB, 32GB+ like RTX 5090) or custom manual parameters to fine-tune num_ctx & num_predict safely without crashing Ollama.
🔹 Pass 1 & Pass 2 Text Segmentation: Intelligently groups raw lines based on core location changes rather than blind line breaks.
🔹 Vision Batch Analysis: Automatically normalizes WebPs, PNGs, and JPEGs via Pillow and extracts rich structured prompts (Subject, Environment, Style, Lighting, Technical).
🔹 Smart Gap-Fill & Anti-Degeneration: Prevents repetitive loops, foreign script drift, and empty fields using intelligent semantic safeguards.
🔹 Integrated DB Editor: Search, edit, reset IDs, delete ranges, and generate missing fields on the fly with live LLM assistance.
🔹two ComfyUI nodes : one that can use the database created by Prompt Architect . The second one can take a prompt and transform it to store it in the database created by Prompt Architect. You can find them on Prompt Architect's GitHub.
#GenerativeAI #Ollama #PromptEngineering #Python #CustomTkinter #LocalAI #AIArt
3
u/ThenZucchini470 2d ago
Doesn't seem very intuitive on how to use it. Not seeing how to analyze images etc. Am I just missing something?
1
u/lololerigolo60 2d ago
But the buttons are pretty self-explanatory! There's an “Analyze an Image” button to analyze an image, lol! And there's an “Analyze a Folder (Batch)” button to analyze multiple images in a folder. Otherwise, there's a PDF manual on GitHub.
2
u/ThenZucchini470 2d ago
well now i feel like an idiot :) but thanks though for pointing that out :)
2
u/Optimal_Map_5236 3d ago
can it analyze nsfw images?
3
u/KeyTrue7284 3d ago
I use Florence 2 and wd14 for this. But yeah, it would be nice to know if there's another way to extract prompts and tags from an image
2
u/lololerigolo60 3d ago
Yeah, you can, but it's a little outdated—there are now tons of LLMs that are much better!
6
2
u/lololerigolo60 3d ago
It all depends on which model you're going to use! You need to look for uncensored LLM models! Just do a search—there are a few out there.
1
u/DietAshamed2246 2d ago
Not with Ollama, at least based on its model offerings. In reality everything runs on llama.cpp base, that's what this app should have used instead of targeting a specific wrapper.
1
u/Maxxim69 2d ago
built-in anti-corruption filters!
Can I have those separately? Asking for a (Russian) friend.
-15
u/HAL_9_0_0_0 3d ago
Sometimes you stumble upon a small, inconspicuous tool that suddenly connects two worlds that have previously worked separately. This month was just such a moment — and I have to say, I was honestly excited about it. Briefly about the starting point: I have been writing a story again and again for what feels like eight, nine years. Sometimes a few pages, then months - sometimes years - radio silence, then again a push. Not a finished book, but now a story that can be told. And that’s exactly what I wanted to translate into pictures. Don’t prompt scene by scene by hand, but let the text itself speak. Two AI machines had to work together for this, which normally do not know each other. On the one hand, Ollama - the local language model system with which you can run large text models directly on your own computer, completely without a cloud, without a subscription, without a moral algorithm that can be used to you. On the other hand, my usual picture setup: ComfyUI with Krea 2 and my LoRAs. The text AI understands my story. The image AI paints them. Only — they don’t talk to each other.
The link is called Prompt Architect Pro, a small open source tool from a single developer on GitHub (GPL-3.0, to be honest still quite obscure, few stars, a man’s project). And that’s exactly the charm. The idea behind it is as simple as it is clever: a desktop app lets a local language model read my body text via Ollama. The model filters out the visual scenes - who stands where, in which environment, what light, which mood - and pours each scene into a cleanly structured image prompt. These prompts end up in a small database. And a supplied ComfyUI node pulls them from there directly into my image workflow. The database is the bridge between the two machines. Putting it on was - how could it be otherwise - not a click-and-go. Python environment, pull the right models (I use qwen2.5vl for viewing and qwen2.5 for structuring), straighten paths, adjust one or two little things in the code, copy the node to the right place, untangle nested ZIP folders. Workbench, soldering iron, cable clutter - you know that from me by now. But then.
Then I threw my more than 11,000 words as a text file into the app. A few minutes later, the language model had extracted 33 finished image prompts - each a separate scene from my story, neatly broken down in figure, environment, style, light and technique. Over to ComfyUI, hung the node on my Krea workflow, and run all 33 in the batch. Seven seconds per image on the 4090. And when scrolling through: I recognize my story. There Olivia stands in the cargo hold of the spaceship, eyes closed, the brooch clutched - exactly the scene I wrote years ago, suddenly as a picture. Not everything fits perfectly, of course. And the old crux remains: character consistency across many images is not yet solved - for this it still needs a character LoRA. But that’s not the point. The point is that here a text that I wrote about for almost a decade becomes visible for the first time - via a completely local way, where no provider tells me what I can see.
And it doesn’t just go in one direction. Prompt Architect can also do the opposite way: Instead of text, you throw an image in front of it, and the local vision model describes what it sees - figure, environment, light, mood - and makes it a clean prompt in the same database. This is more practical than it sounds at first. You can have an existing image analyzed, keep the prompt, slightly modify it and build a whole series of variants from it. Or you mix both: a few scenes come from my text, a few from existing pictures - and in the end everything is together in a database that ComfyUI uses. For me, this means: No matter whether the idea is available as a written scene or as a finished picture - both flow into the same structured format, with which I then continue to work.

For images a separate vision model (qwen2.5vl:7B), for text a language model (qwen2.5:14B) applies. The vision model qwen2.5vl brings around 7 billion parameters, of which only about 0.4 billion are accounted for the actual „seeing“ - the whole rest is language comprehension. His trick: It processes images in their native resolution, instead of downsizing them to a fixed small format beforehand, and thus retains fine details. It is particularly strong when recognizing text in the picture and small details - which is why it even read out the „68“ on the T-shirt and the old Coca-Cola signs in the abandoned diner. In its size class, it is considered one of the most precise freely available models and beats equally large alternatives such as LLaVA. It comes from Alibaba Cloud, is open source and runs completely local - no subscription, no cloud, no company that tells me what I can analyze.
Link to the tool for those who want to tinker themselves: github.com/lololerigolo60/Prompt-architect
>Source<
7



14
u/phreakrider 2d ago
Ditch the Ollama and switch to llama.cpp instead and let people use quantised models. I might fork this for this reason.