Example  scenarios
 

Depending on your current proficiency with Scripthea and Stable Diffusion, here are some example scenarios to
guide your exploration. These are not strict tutorials but rather flexible pathways to help you experiment and learn.

What are you doing?                    

How do you do it?                                

0. Starting from Scratch: installations, some reads and how to run Scripthea with Stable Diffusion

After having Stable Diffusion with WebUI (SDW) working try some SDW options following this intro or github location you have downloaded the installation from. If you prefer video tutorials - here are some.

1. Some initial experimentation: cues, modifiers, single queries

Are you looking to how all this works. You may have some vague idea what you wish to accomplish, you have seen some examples here and there but how to do it yourself is a bit more complicated. You may try so called in the introduction a traditional approach. You need some level of clarity what do you want the picture to look like. Maybe not in details but as a general impression. Some may call it style, others - ambience but the point is that you are looking for something specific to satisfy your sense of expression (or maybe art). See Prompt writing tips or Exctract from an ext. collection  below.

You need to experiment with different cues, modifiers and SDW options. The third one is a bit more tricky and it depends on in which way you connect to SDW. If it is via API you may adjust SD parameters from the tab Stable Diffusion (right on the Composer).

After having previous section executed, you can start some initial experimentation / tests.
  • turn to Prompt Composer main tab
  • turn to Options tab, there select the working image depot folder from the directory tree on the left. All generated images you will go into that folder.
  • turn to Single tab (mode) and check Auto-refresh (if it is unchecked)
  • select your cue list of choice and after some browsing select a cue you like.
  • from the lists of modifiers on the right select (check) some modifiers 
  • click on Generate and you will see the result bellow the log on the left
     
  • repeat and play with some of the Single mode options until you have some sense of control at this stage
2. More systematic approach: scan mode, scannable modifiers and review

As we established earlier a prompt = cue + modifiers. In scan you have the opportunity to combine a number of cues with number of modifiers. There are different ways you can do that using two types of modifiers: fixed and scannable.

The simplest one is using some cues with some fixed modifiers: the result will be a list of all selected cues with the fixed modifiers at the end. Then you add scannable modifiers to the mix: the result will be combination of all the cues with all fixed modifiers and one or more (check the Sample number in Modifiers options) scannable modifiers.

The best way is to experiment a bit with all types of modifiers and sample number.

Overall aim here is to be able to create predictable results. Maybe not exactly what you've expected, but achieve some level predictability.   

After some experimentation you will have some sense how the software works and what you may expect from the prompts you have composed.
  1. turn to Prompt Composer main tab
  2. turn to Options tab, there select the working image depot folder from the directory tree on the left. All generated images you will go into that folder.
  3. turn to Scan tab (mode).
  4. check some cues and some modifiers - some fixed [F] and some scannable [S].
  5. click on Scan preview button and examine the composed list of prompts.
  6. repeat 4 and 5 until you have a good grasp of how that works.
  7. repeat 4 and 5 and this time try some modifier options (top/left arrow on modifiers panel).
  8. do a real scan, either from Scan tab / [Scan] button or from scan preview panel / [Scan all checked] button
  9. you can follow the image generation and at the end turn to Image Depot Viewer main tab to overview the just-created image depot.
 
3. Full systematic approach: ratings and iterations towards your goal

After having experimented with scenario 2 you need to use the resulting image depot for next iteration on your way. The simplest way is just to delete (key Delete in viewer or use ID Master) unwanted images from your image depot. A better way would to rate your images and then use ID master to copy all the images above certain level in a new image depot. That way you will have your first iteration image depot.

Then, open that image depot in Image Depot tab (next to Editor) or import it to a cue list in the Editor. Either way use iteration image depot with some modifications to scan and create a second iterations. The thing you try could be more modifiers or some SD parameters adjustment including an alternative model. After you delete and rate again and you see where this is going.

Do as many iterations as you have time/efforts to do. It's a good practice to keep all intermediate image depot iterations in case you fail to improve or you feel stuck (hit a wall). 

Execute the first 5 steps from scenario 2 (see above), you may call the resulting image depot iteration 0 and then:
  1. in Viewer you delete all the images you really don't like
  2. at the same time or after step 1 you rate all the images you like.
  3. go to Image Depot Master and open that image depot, click on a Rt column header to sort prompts by rating.
  4. chose some level of rating and copy all the images above that level into a new image depot. That is your next iteration image depot.
  5. open that image depot in Image Depot tab (next to Editor) in cues/pools panel.
  6. introduce some modifications as more modifies or some SD adjustments and scan.
  7. with the scan results and go to step 1 here and repeat until
    7.1 you get tired, then you continue later OR
    7.2 you don't see any improvement, then you go back to the previous iteration and introduce deferent modifications
  8. For one reason or another you decide that this is a good time to be satisfied.

 

4. Final preparation: upscaling, final touches and publishing

1. Upscaling is always optional. Maybe your generator can make images with sufficient for you as quality and resolution. If not - see on the right.

2. Final touches usually involve some photo-editing software.

3. There are plenty of public depositories specialized in AI-generated images and/or photography. The variety is impressive. Still, if you decide to do it yourself - see on the right.

 1. For ComfyUI upscaler follow these video instructions .
In Automatic1111 you go to Extra tab, pick a upscaling method, set a scale factor and give it some time, you can do a batch of images (a folder) as well. For more - see this video clip.

2. Photoshop is very popular and powerful, but it is not cheap and it could be complicated at times. One good and free alternative of PS is GIMP (see a demo clip).

3. After having all of your images in one image depot you may like to public them (or selected subset) on your website. Scripthea Export utility will allow you to export them into a generated webpage.

My photo-gallery website (https://photothea.com) includes some AI-generated pics. For that I'm using https://piwigo.org/ - very good, free and quite versatile if you speak a bit of PHP.


Prompt writing tips

All of these scenarios assume using the prompts provided by Scripthea or some variations of them. Still if you decide to write your own prompts from scratch here are some useful tips: 

  1. Be specific: The more specific and detailed your prompt is, the more specific and detailed your generated image will be.

  2. Mood: What emotions do you want the image to evoke? Do you want it to be peaceful, dramatic, joyful, mysterious, etc.?

  3. Style: Do you have a specific artistic style in mind? For example, do you want the image to be realistic, impressionistic, whimsical, abstract, etc.? You can reference famous artists or art movements for inspiration.

  4. Use descriptive language: Use vivid and descriptive language to help the model understand what you want the image to look like. For example, instead of saying "a black dog," you could say "a sleek, black dog with a shiny coat and a wagging tail."

 
  1. Provide context: Give the model some context about the image you want to generate. For example, if you're generating an image of a dog, you could provide some information about the breed, age, and environment.

  2. Use relevant keywords: Include relevant keywords in your prompt to help the model understand the topic of the image you want to generate. For example, if you're generating an image of a dog, you could include keywords like "dog," "puppy," "bone," "fetch," etc.

  3. Be creative: Don't be afraid to get creative with your prompt! You can use metaphors, similes, and other literary devices to help the model generate a unique and interesting image.

Search the internet or YouTube if you prefer for more detailed guides, there is no shortage of them. Here is a YouTube example.
You could ask some chatbot (e.g. ChatGPT) to do it for you but you have to explain to the chatbot what would you like the image to be and we've got catch 22...

Extract from an external collection

External collections are great source of prompts. As total size of more than 1.5 million unique prompts is impressive and overwhelming at the same time. The individual ext. collection size varies from several thousand to couple hundreds of thousands. Individual cue list typically has between from couple of tens to couple of hundreds of cues. 

The extraction dialog provides some basic and some sophisticated methods to extract cues list from ext.collection according to what you intend to do next or just general your preferences. You can start with the couple of collections which come by default, but ext.collection manager (round wavy button) will help you download/install many more. Plus from best results I would recommend semantic matching which requires semantic extension, downloadable via the same manager. 

 

Filter options for prompt extraction:
  1. segment - consider only part of the collection;
  2. size in words - limit the prompt length;
  3. for some external collections you can add a categories selection and sensitivity to the selection criteria (see on the right). All the prompts in such a collection are categorized in up to 3 categories, using by Meta's LLama 3.3 70B model in LM Studio. The categories attributed to one prompt have weights in percents. The sensitivity is the threshold above which any of selected above categories will trigger selection. A sensible sensitivity would be between 20% and 70%. Very useful feature, try it for more clarity.
  4. compare the text from Text Matching to extracted list at that point using one of three methods:
  • Simple: look for a particular word(s) in a Text Matching field, that is simple search (as in the viewer)
  • RegEx. (Regular Expressions) is very powerful search tool but it uses specific syntax for matching e.g. (girl|woman) in RegEx mode will extract all the prompts containing the words "girl" or "woman". Here are nice quick reference and tutorial or you can browse around for more.
  • Semantic: this method ranks all the cues at this stage against the text by semantic similarity (cosine normalized distances) and extract the best (top) ones to pass them further. If the text field is empty or Top number is 0 Scripthea will skip semantic matching. You can interrupt the matching from the red button next to Top number.
    The semantic method is noticeable slower than the others but because it runs on a parallel thread you can do something else inside Scripthea while waiting for the semantic matching to finish. You will be reminded for the ongoing semantic matching by "waiting" shape of the mouse cursor.
  1. limit the length of result list by random sampling to a certain cue count.