šŸ‘‹šŸ»  Hello!

Thanks for visiting! You'll find a bunch of musings I've been writing around these parts since the early 2000's. Lately, I've been reviewing a lot of books. But I also write about code. But really, you're just here to see pictures of Benson.

Upgrading Mr. RossBot’s image model and prompt template

My Mastodon landscape painting bot, Mr. RossBot keeps kicking along, generating some fun landscape art. Itā€™s been powered by the AI Horde (the open source project behind ArtBot) and has tried to utilize whatever image models provided by the API to the best of its abilities.

For the most part, the code behind it is a bunch of spaghetti that looks like this:

An update to the AI Horde late last year added support for SDXL. However, the SDXL model on the Horde did not use a refiner. Because of this, images tended to come out a bit soft and lacked texture.

You can see examples of this in my announcement post about Mr. RossBot being back, here. See also:

More recently, the Horde added support for a new image model: AlbedoBaseXL. Itā€™s an SDXL model that has a refiner baked in. Now images will come out a lot sharper looking.

Coincidentally, I was also playing around with various prompts and discovered I could get much better image results that look more painterly (rather than simple digital renderings) by utilizing the following prompt:

A beautiful oil painting of [LITERALLY_ANYTHING], with thick messy brush strokes.

And that is it! No more messy appending various junk to the end of the prompt to attempt to get what I want. The results speak for themselves and are pretty awesome, I think!

TIL: Local overrides in Chrome

Iā€™ve been doing web development professionally for about 10 years now and just discovered something new. (I love it when this happens!)

Today, I learned about local overrides in Chrome. Local overrides are a powerful feature within Chromeā€™s Developer Tools that allow developers to make temporary changes to a web pageā€™s files (CSS, JavaScript, images, etc.) directly within the browser.

These changes are saved to your local filesystem, allowing you to experiment with modifications without affecting the live website. This is especially useful for testing, debugging, and experimenting with different designs or functionalities.

Hereā€™s how you can use local overrides in Chrome:

  1. Open Chrome Developer Tools:
    ā€“ Right-click on any webpage and select ā€œInspectā€ or press `Ctrl+Shift+I` (Windows/Linux) or `Cmd+Opt+I` (Mac).
  2. Enable Local Overrides:
    ā€“ Go to the ā€œSourcesā€ tab.
    ā€“ In the navigation pane, click on the ā€œOverridesā€ tab (you may need to click on the ā€œ>>ā€ to see it).
    ā€“ Click on ā€œSelect folder for overridesā€ and choose a folder on your local system. This is where your changes will be saved.
    ā€“ Allow Chrome to access the folder if prompted.
  3. Start Editing:
    ā€“ Find the file you want to edit in the page file navigator pane. You can navigate through the websiteā€™s file structure or find the file in the ā€œNetworkā€ tab.
    ā€“ Right click on a file and select ā€œOverride contentā€
    ā€“ Once you open a file, you can modify it directly in the editor pane. Your changes will be reflected in real-time on the webpage.
  4. Save Changes:
    ā€“ After editing, press `Ctrl+S` or `Cmd+S` to save your changes. These changes are saved to the selected local folder and will override the network resource until you disable overrides or delete the local file.
  5. Disable Overrides:
    ā€“ To stop using local overrides, simply uncheck the ā€œEnable Local Overridesā€ option in the Overrides tab.

Local overrides are a temporary way to experiment with web page modifications. They donā€™t affect the actual files on the web server, so other users wonā€™t see these changes. This feature is highly useful for developers and designers to test changes without deploying them to a live server.

Happy Museum Selfie Day

About 2 years ago, I found one of these cheesy sites that lists whatever fake holiday happened to be celebrated that day (e.g., ā€œNational Avocado Toast Dayā€)

I ended up starting every daily standup meeting with a call out to whatever the day was. This went on for about a year before I switched to a different internal team. One that didnā€™t have much in the way of daily meetings.

A few weeks ago, I made a move back to my original team, only to find that they have kept the tradition alive over the past year!

Amazing.

And with that: Happy Museum Selfie Day!

Created with DALL-E 3

Implementing and testing a “poor man’s prompt expansion” model for Stable Diffusion

Various Stable Diffusion models massively benefit from verbose prompt descriptions that contain a variety of additional descriptors. Much recent research has gone into training text generation models for expanding existing Stable Diffusion prompts with relevant and context appropriate descriptors.

Since it isnā€™t feasible to run LLMs and text generation models inside most usersā€™ web browsers at this time, I present my ā€œPoor Manā€™s Prompt Expansion Modelā€œ. It uses a number of examples Iā€™ve acquired from Fooocus and Hugging Face to generate completely random (and absolutely not context appropriate) prompt expansions.

(For those interested in following along at home, you can checkout the gist for this script on GitHub).

How does it work?

We iterate through a list of an absolute crap ton of prompt descriptors that Iā€™ve sourced from other (smarter) systems that tokenize user prompts and attempt to come up with context appropriate responses. Weā€™re not going to do that, because weā€™re going to go into full chaos mode:

  1. Iterate through a list of source material and split up everything separated by a comma.
  2. Add the resulting list to a new 1-dimensional array.
  3. Now, build a new descriptive prompt by looping through the list until we get a random string of descriptors that are between 175 and 220 characters long.
  4. Once thatā€™s done, return the result to the user.
  5. Create a new prompt.

For our experiment, weā€™re going to lock all image generation parameters and seed, so we theoretically get the same image given the exact same parameters.

Ready?

Here is our base prompt and the result:

Happy penguins having a beer

Not bad! Now, letā€™s go full chaos mode with a new prompt using the above rules and check out the result:

Happy penguins having a beer, silent, 4K UHD image, 8k, professional photography, clouds, gold, dramatic light, cinematic lighting, creative, pretty, artstation, award winning, pure, trending on artstation, airbrush, cgsociety, glowing

Thatā€™s fun! (Iā€™m not sure what the ā€œsilentā€ descriptor means, but hey!) Letā€™s try another:

Happy penguins having a beer, 8k, redshift, illuminated, clear, elegant, creative, black and white, masterpiece, great power, pinterest, photorealistic, award winning, vray, enchanted, complex, excellent composition, beautiful composition

I think we just created an advertisement for a new type of beverage! It nailed the ā€œblack and whiteā€, though Iā€™m not sure how that penguin turned into a bottle. What else can we make?

Happy penguins having a beer, volumetric lighting, Digital, intricate, awesome, futuristic, cartoon artstyle, vector, solid, detailed, dramatic light, realistic photograph, wonderful colors, dramatic atmosphere

The dude in the middle is planning on having aĀ good night. Definitely some ā€œwonderful colorsā€. Not so much realistic photo or vector, but fun! One last try:

Happy penguins having a beer, 35mm, surreal, amazing, Trending on Artstation HQ, matte painting hyperrealistic, full focus, very inspirational, pixta.jp, aesthetic, 8k, black and white, reflected on the matrix studio background, awesome

As you can see, you can get a wide variety of image styles by simply mixing a bunch of descriptive elements to an image prompt.

Iā€™ve wanted to implement a feature like this on ArtBot for a long time. (Essentially, if the user allows it, automatically append these descriptions behind the scenes when an image is requested). Perhaps this will come soon.

TIL: The coastline paradox and Baader-Meinhof phenomenon

ā€œUh, what?ā€ you say.

A few weeks ago, I read a post on Hacker News about something called ā€œthe coastline paradox.ā€ Despite my geology background, I hadnā€™t heard of this before.

The measured length of the coastline depends on the method used to measure it and the degree of cartographic generalization. Since a landmass has features at all scales, from hundreds of kilometers in size to tiny fractions of a millimeter and below, there is no obvious size of the smallest feature that should be taken into consideration when measuring, and hence no single well-defined perimeter to the landmass.

Essentially, the smaller unit of measurement you use to try and measure something with a fractal pattern, the longer it becomes.

So, Iā€™m currently reading a book called ā€œReading the Rocksā€ by Marcia Bjornerud and there is an entire section devoted to the coastline paradox, which I just learned about.

Mandelbrotā€™s point was simple: If you use a very long stick to measure a coastline, you will capture the broadest arcs but miss the fjords, firths, and coves, and you will conclude that the coastline is not terribly long. As you use shorter and shorter rulers, however, the coast actually stretches. Mandelbrot named such stretchy features fractalsā€¦

Neat!

This brings up the second TIL:Ā What is the phenomenon called when you hear something for the first time and then suddenly start seeing or hearing it everywhere?

Itā€™s the Baader-Meinhof phenomenon, also known as the frequency illusion:

The frequency illusion (also known as the Baader-Meinhof phenomenon) is a cognitive bias in which a person notices a specific concept, word, or product more frequently after recently becoming aware of it.

Well, hereā€™s to seeing more coastline paradoxes.

Cool dad, sad dad

A few years ago, I got a new longboard for Christmas. The kids and I went out in the neighborhood and I decided I was going to be cool and ride my board as we walked around.

I immediately fall off and nearly sprain my wrist. To this day, our oldest still brings it up.

This past Christmas, we got some rad new scooters for the little ones and decided to take them around the block for a spin. Itā€™s been awhile since Iā€™ve ridden my board so I grab it and walk out the door.

ā€œBe careful and donā€™t fall, Dad!ā€ she says.

Listen here, kiddo. I may have a few more grey hairs than I did in the past, but I can still do this. Donā€™t worry!

Not even 2 doors down the street, I eat it and sprain my wrist.

I guess itā€™s going to be awhile yet before I can do thisā€¦

Ā 

My 2023 Reading List

I didnā€™t do a great job of reviewing every book I read this year, but still read a good number of books this year. My Goodreads goal was 24 books and I hit 30.

This is down from 40 in 2022, 56 in 2021, and 60(!) in 2020. Kind of an interesting correlation between the pandemic years and what has happened as weā€™ve come out of various lockdowns (e.g., more activity outside is less time reading inside).

Anyway, this yearā€™s list of books is below. My favorites wereĀ The Making of the Atomic BombĀ andĀ Tracers in the Dark. My least favorite was easilyĀ Blindsight.

My top music of 2023

Chuck Ragan of Hot Water Music (taken by me)

Itā€™s time for the yearly (semi-yearly?) update of my favorite bands according to Last.FM. It is kind of all over the place this year!

1. Chuck Ragan
2. The Glitch Mob
3. Creedence Clearwater Revival
4. Vansire
5. The Lawrence Arms
6. AFI
7. The Interrupters
8. Deer Tick
9. Two Gallants
10. The Rolling Stones