Usual disclaimers: I'm not a doctor, legal professional or financial advisor. This article is for information/education only and reflects my own opinions. It should not be taken as financial, legal or medical advice. Do your own research and never invest anything you cannot afford to lose (including your time).

1 July 2023

Unstable Diffusion?

I've been running Stable Diffusion locally now for about three weeks. It's not the fastest on this old windows box but it does run (or did). I'm not sure what's gone wrong with it right now but I am attempting some fixes so by the end of it I should have figured out what caused the issue or at least how to get it running again. The blitz option is to move the additional lora's and model checkpoints I've downloaded into a safe place and then just blitz the install folder and start again.

That seems a bit extreme though. I think it was an extension I attempted to install which has caused the problems, but once things go wrong it has a tendency to stop running the local web-server so you can't get back into the settings page and undo your recent changes.

The weird thing is while things are up and running, you can actually save your config but I couldn't find any way to revert back to that once it's borked. One thing I have noticed is in the venv folder there's a file called 'pyvenv.cfg' which stores the path to python 3.10. I dislike hard-coded paths as I've seen them cause all sorts of issues in the past, especially when the user updates something and thinks they're now running the latest version of something but actually because of a hard-coded path they might still have a vulnerability which is the reason why they upgraded a package.

If you've never installed Stable Diffusion before and want to give it a go, you will need a lot of patience as some of the downloads are 4GB+ and I also recommend this tutorial from Matt Wolfe. If you manage to kill your installation and do decide to reinstall, don't forget to move your output images first to be on the safe side. These will be in the outputs folder of your install directory. I highly recommend creating a backup folder and moving any downloaded models, Lora files and your output images into there for safe-keeping while you reinstall.I highly recommend a visit to https://civitai.com/ to enhance your S/D model collection once you have got to grips with the installation model(s). Realisian_V40 has produced some fantastic images for me. As for extensions, the first I recommend is ControlNet and there's a good video on YouTube by Olivio Sarikas which is useful to get this up and running and explores some of the things you can do with it.

And now back to troubleshooting. There are a few suggested fixes for common issues here but sadly nothing to fix the issue with my installation.This is the error it throws for me:

 building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects

I've tried installing visual studio and the windows 10 & 11 sdk's as suggested by some reddit articles but so far they haven't fixed the issue. That visual studio installer download is also another lost day imho and I will probably end up removing the installation once S/D is fixed.



I'll have to come back to this tomorrow. If you are sorely missing your S/D installation like me, it's worth remembering that you can always use the online version until you get it working again.


12 June 2023

Either Stable Fashions or AI need a new look?

 Introduction:

I'm constantly searching for tools and tech to make work/life easier so it was inevitable I would end up on the current bandwagon of choice. AI is everywhere at the moment so in order to learn more about the capabilities of the various available platforms out there, I came up with a test based on a personal task that tbh, I would fob off onto a virtual assistant if I had one. I'm talking of course about that great drain on the soul of every guy on the planet. The idea of getting home from a busy week at work and then at the weekend venturing out to the local trading mecca and spending several hours dodging people, bright-blinding sale posters, crowds of people who seem to want to collide with you and shops forcing their mind-altering suggestions of what you should be wearing onto your retinas rather than hiring knowledgeable advisors who can explain how a classic-fit is different to a regular fit. What should I be asking for though? I don't have time to become a style-guru so as encouraging people to part with their hard-earned is going to be the primary use of AI as far as all those internet marketers are concerned, why not bite the bullet now and see how bad things are going to get. Who knows, maybe we'll be pleasantly surprised.


So my experiment will ask three different AI platforms for some style guidance. I'll then get the platform to condense that into a prompt for Stable Diffusion online, so I can see what another AI thinks that looks like. After all, a picture is worth a thousand words. The platforms I've decided to put to the test are ChatGPT, Google Bard, and Perplexity.AI. Each platform will be rated based on the usefulness of the image although I will probably hit refresh a subjective number of times until I get something which I think is useful to me. I will provide each platform with the same information about me; size information, preferred colours etc. but the platforms will be tasked with figuring out what I should be wearing and I'll measure the success by the image produced from the output prompt.


So what are the common parameters. Well I'm around 5/7, not enviably slim and my favourite colours are light greys, browns, navy blues and blacks. Let's see how the platforms compare when it comes to smart-casual advice based on my frame. So, even though it would be best to tweak my prompts for each AI, I'm just going to go with this prompt and see what they come back with:

I'm a short guy around 5ft 7, not the slimmest frame but not obese. My favourite colors are light greys, browns, navy blue and black. Figure out what the best advice would be for a smart-casual outfit for me, with any accessories to complete the look. Turn this into a prompt for stable diffusion so I can see how this outfit would look on a shop mannequin


ChatGPT

ChatGPT is probably the most famous AI at this moment in time. Is it any good for clothing advice though since it was trained by scraping internet data up to 2021. This suggests it might not be the best choice for up-to-the-minute fashion advice. Then again classics never go out of fashion or so they say. I had to slightly tailor the prompt as there were just too many dresses and high-heeled shoes for my liking. So I ended up with this:

"Create a smart-casual outfit that perfectly suits a short guy with a height of around 5ft 7. The person has a moderate build and favours colors like light greys, browns, navy blue, and black. The outfit should be accompanied by suitable accessories to complete the overall look. Visualize this ensemble on a shop mannequin, allowing us to see how it all comes together in a stylish and cohesive manner."


Here's what Stable Diffusion decided that ChatGPT wanted to show me:


Ok so there's still high-heels in there but I could have put that in as a negative prompt. I think it's more important for the test to try to stick to the original output prompt as much as possible, but to be fair I opted to do the same tweaks with output prompts for the other platforms too if necessary. I think this was caused by ChatGPT deciding that I was an 'individual' rather than a guy. The lesson here may be that bias should not overrule fact and we should remember that Darwin ultimately died for the right to observe species and classify according to observations. 


Google Bard

Google Bard was an interesting test. Before spewing out it's stable prompt, it decided to actually feed me some fashion advice and highlight a few products for me. In fact it suggested a pair of shoes which were very similar to a pair I bought in the last month. Here's the prompt which Bard decided to give me for Stable Diffusion:

"Create a 3D rendering of a shop mannequin wearing a light grey button-up shirt, dark brown chinos or jeans, brown leather loafers or boots, a brown leather belt, a pocket square, and a watch. The mannequin should be 5ft 7 and have a medium build. The colors should be light grey, dark brown, navy blue, and black."

And here is the result. I'm not sure about the 3D rendering as I actually thought the options Bard decided to show me before this stage were better than the rendered guesses. Maybe that show that an AI which is able to call up exact images should be judged on the original content rather than the alternate AI imagined image.



Perplexity.AI

Like Bard, Perplexity has access to the internet so in theory options could be from more recent sources. Like Bard, it also offered me some fashion tips before the prompt which were well presented and in bullet-point. I liked this as keeping the advice to short tips is really good for imprinting on your mind the characteristics of what suits you best. Here's the  prompt Perplexity offered:

"Create a smart-casual outfit for a short guy around 5ft 7 with a not-too-slim frame. The outfit should include dark denim jeans, an unstructured navy blazer, a white shirt, and dark leather shoes in brown or black. Accessories should be kept to a minimum, with a leather belt in black or dark brown, a square in light or pale blue, a smart watch, and smart sunglasses as options."

Here's how that looks according to Stable Diffusion.



Conclusions:

I guess you have to keep in mind that these things are still very new to most of us. Based on these initial images though I think Perplexity currently comes out on top. ChatGPT's reluctance to accept I might be male even though I identified as 'a guy' no doubt threw a spanner in the works when it came to shoes. Bard's actual advice was great however it's attempt to convey that via a Stable Diffusion prompt was lacking. It's very early days for Bard though so let's wait and see what happens. Perplexity definitely came out on top for me with this test. Those images look like they could have come straight from 'Short-guy, fashion advice weekly' or some equivalent publication. 


Resources:


Stable Diffusion Online

Perplexity.AI

Google Bard

ChatGPT