Install Stable Dreamfusion on Windows

Install Stable Dreamfusion on Windows

I wrote about Stable Dreamfusion previously. Dreamfusion first takes normal Stable Diffusion text prompts to generate 2D images of the desired object. Stable Dreamfusion then uses those 2D images to generate 3D meshes.

A hamburger

The authors seemed to be using A100 nVidia cards on an Ubuntu system. I wanted to see if I could get this to work locally on my home Windows PC, and found that I could do so.

System configuration I am using for this tutorial:

  • nVidia GeForce GTX 3090
  • Intel 12th gen processor
  • Windows 10

Setting Stable Dreamfusion up locally:

Step 1: Update your Windows and drivers

  1. Update Windows
  2. Ensure you have the latest nVidia driver installed.

Step 2: Install Windows Subsystem for Linux (WSL)

  1. Install Windows Subsystem for Linux (WSL). WSL install is a simple command line install. You’ll need to reboot after you install. You want to make sure you install Ubuntu 22.04, which is the default in Feb 2023 since that is what Stable Dreamfusion likes. Currently WSL installs the latest Ubuntu distro by default, so this works:
    wsl –install
    If you want to make sure you get Ubuntu 22.04, use this command line:
    wsl –install -d Ubuntu-22.04
  2. After installing WSL, Windows will ask to reboot.
  3. Upon reboot, the WSL will complete installation and ask you to create a user account.
  4. Start Ubuntu 22.04 on WSL by clicking on the Windows Start menu and typing ‘Ubuntu’ or you can type Ubuntu at a command prompt and type ‘Ubuntu’.

Step 2b (optional): Install Ubuntu wherever you want on your Windows system. By default it installs the image on your C:\Users directory – which is kind of annoying.

Step 3: Install dependent packages on Ubuntu

  1. If you don’t have Ubuntu started, go ahead and start Ubuntu 22.04 on WSL by clicking on the Windows Start menu and typing ‘Ubuntu’ (or you can type Ubuntu at a command prompt as well). A new shell terminal should appear.
  2. You need to install the nVidia CUDA SDK on Ubuntu. You’ll choose one of these two options:
    • You will then get a set of install instructions at the bottom of the page (wget, apt-get, etc). Simply copy the lines one by one and put them into your Ubuntu terminal. Ensure each step passes without errors before continuing.
    • The ‘sudo apt-get -y install cuda’ line will install a lot of packages. It can take 10-15 minutes.
  3. Install python3 pip. This is required for the Dreamfusion requirements installation script.
    • sudo apt install python3-pip

Step 4: Install Stable Dreamfusion and dependent packages

  1. You should now follow the install instructions found on the Dreamfusion page.
  2. Clone the project as directed: git clone https://github.com/ashawkey/stable-dreamfusion.git
  3. Install with PIP: Install the pre-requisites via pip as directed on the Dreamfusion github page:
    • pip install -r requirements.txt
    • I also installed both optional packages nvdiffrast and CLIP.
    • Add this export line to your .bashrc to ensure python can find libcudnn:
      export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH
  4. I did not install the build extension options
  5. Exit and restart your shell so that all path changes take effect

Step 5: Run a workload!

Follow the instructions in the USAGE section of the Dreamfusion instructions. Instead of ‘python’ use ‘python3’. They have a number of things you can specify like negative prompts, using the GUI interface (which does not work under WSL),

The very first run will take a long time. It will download several gigabytes of training data, then train 100 epoch’s, which can take up to an hour.

$> python3 main.py --text "a hamburger" --workspace trial -O 
$> python3 main.py --text "a hamburger" --workspace trial -O --sd_version 1.5 
$> python3 main.py --workspace trial -O --test 
$> python3 main.py --workspace trial -O --test --save_mesh 

Check Your Output:

Look in the results directory under the workspace name:

.\stable-dreamfusion\<workspace name>\mesh\ #directory holds the .obj, .mat, and .png files
.\stable-dreamfusion\<workspace name>\results\ #directory holds a mp4 video that shows the object rotating

Copying them to Windows:
All Windows drives are pre-mounted in \mnt\<drive letter>\ for WSL.
Ex: \mnt\c\
So you can copy the output files to your windows side by doing:
cp -rP .\<workspace name> \mnt\c\workdir\

Looking at the generated meshes with materials:

  1. Install Blender
  2. File->Import->Wavefront (.obj) (legacy)
  3. Or, use 3D Viewer (though it seems to have issues with material loading at times)

Fixes:

  1. You might get an error about missing libcudnn_cnn_infer.so.8
==> Start Training trial Epoch 1, lr=0.050000 …
0% 0/100 [00:00<?, ?it/s]Could not load library libcudnn_cnn_infer.so.8. Error: libcuda.so: cannot open shared object file: No such file or directory

add this to your .bashrc to ensure it can find libcudnn:
export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH

2. If you load the object in Blender but it doesn’t load the texture maps, try Alt-Z

Links:

Midjourney intro + prompt guide

Midjourney intro + prompt guide

Matt Wolfe briefly walks you through getting Midjourney set up (via Discord) and then gives you some great geting started prompts to help you learn different styles and image generation capabilities.

He also recommends Guy Parsons who gives out lots of tips on building prompts and who has a free e-book with some of his best tips.

Comparing AI art generators for common artist workloads

Comparing AI art generators for common artist workloads

Gamefromscratch decides to do side-by-side results tests on DALL-E 2, Stable Diffusion, and MidJourney for a variety of art generation tasks.

His conclusion is they are not going to replace artist for all tasks, but for concept art, pixel art, and some other simple tasks these AI generators can replace artists.

If you use social media, you should watch this

If you use social media, you should watch this

Smarter Every Day does some amazing videos. While just a few years old, these videos on social media manipulation are even more relevant today than ever. They cover how foreign agents are already manipulating and infiltrating social media platforms Reddit, Facebook, YouTube, and likely countless others. He also shares some good data on how the manipulators work – which echoes almost exactly the techniques used by Ryan Holladay for over a decade and he outlines in Trust Me, I’m Lying: Confessions of a Media Manipulator. All of this information is now about 5-10 years old – so you can imagine how much more sophisticated it has become since then.

If you use social media, this is critical information since it has become crystal clear (from the social media companies themselves, as well as congressional reports) that foreign entities have been doing this for almost a decade now. This was before AI based chat and response bots – which will likely make the volume and sophistication of these kinds of manipulators massively more pervasive and harder to spot.

How close are we a complete world transformation due to AI?

How close are we a complete world transformation due to AI?

Tom Scott distils down his encounter with AI doing a job he used to do (almost equally well) and then reflects on why this could be a completely transformative development for the world – much like when the internet really took off in the late 90’s. I think he’s probably right. As someone that has played with AI art generation and watching the ground breaking papers that are using AI for even traditional rendering and modeling tasks in just the graphics world, I think we’re just at the first part of his sigmoid curve.

This transformation is likely to be very different than just the early internet upheavals of the music industry, cellular phones, and stores/commerce that he describes. Those were largely transformations of market form with the same commercial and societal needs.

I think this is different in at least 2 ways. First, AI is bringing about a change in which thought, analysis, creativity, and response to problems themselves is likely about to be abdicated (and somewhat blindly by the lazy or those that aren’t critically looking at what is being generated). And we’ll be abdicating that power to systems aren’t truly or fully understood, controlled, or protected.

With things like chatGPT, we will very easily start abdicating the hard work of thinking itself. If we no longer crafting the actual language of our responses, doing the hard logical work of building arguments for our daily actions or policies we live by – we will never develop the critical thinking ability to even question what is generated. Instead, they are generated for us. What would that do to us long term? Especially we we already see that chatGPT and other AI systems can get things terribly wrong – and not give us the first clue they are wrong.

Secondly, like all tools, they could even be controlled/manipulated by nefarious agents. Today, our most deadly and horrific tools of destruction (nuclear bombs and sophisticated strategic weapons) are today largely contained within government military systems and by needing the highly specialized ability to build them.

AI can be wielded by anyone, anywhere in the world, with any motivation (political, personal, etc.). With just a small rack of commercially available servers, one has the ability to unleash the kind of infinitely scalable social media posting, auto-responding, narrative controlling, news story generating, and possibly subverted think-for-you devices upon the whole world.

We have known since at least 2019 that this is happening on all major social media platforms despite the best efforts of some of the smartest people in Silicon Valley working on it. Smarter every day did a series of stories on the problem. Research has proven again and again these things are happening and are very, very easy to do and very, very hard to stop:

A few clever AI systems that would likely cost less than a single cruise missile could easily overwhelm social media forums, message boards, Wikipedia edits, generated news articles, etc – before we could ever hope to verify the claims or combat its ability to generate hundreds of thousands of responses, up/down votes, planted webpage articles, etc every hour. How could one even verify the claims if everything is suspect? Why WOULDN’T a country do this if it cost less than what a single missile costs? Even better, what if the AI can be subverted to bias certain responses (which we have already seen too)?

In the post-truth internet, people are well into putting their trust in anonymous influencer opinions and echo chamber forum posts before well verified facts. What will this mean in our internet era in which ‘objective facts are less influential in shaping public opinion than appeals to emotion and personal belief.’?

My how far we’ve come from the idea that the internet would become a forum in which people share ideas and the best ones rise to the top. How dangerously naïve we were…

gigachad bari sax – where’s he now?

gigachad bari sax – where’s he now?

I remember clipping this video of a random busker playing some funky bari sax in New York subways about 10 or so years back. I wonder whatever happened to that guy?

There he is. Looks like Leo was recently at the Royal Albert Hall in London playing front man on the song Moanin’ at the BBC Proms.

Sausage Samba

Sausage Samba

The early internet had some absolute amazing creations. This is one of them. A fantastical mashup of Star Trek TNG and an ode to sausage by Friendly Rich. It’s been out for almost a decade, and only has about 300k views – which is a crime and shows people still lack quality taste even in the modern, post-truth internet era.

Leaking corporate code via chatGPT

Leaking corporate code via chatGPT

After catching snippets of text generated by OpenAI’s powerful ChatGPT tool that looked a lot like company secrets, Amazon is now trying to head its employees off from leaking anything else to the algorithm.

This issue seems to have come to a head recently because Amazon staffers and other tech workers throughout the industry have begun using ChatGPT as a “coding assistant” of sorts to help them write or improve strings of code, the report notes.

While this isn’t necessarily a problem from a proprietary data perspective, it’s a different story when employees start using the AI to improve upon existing internal code — which is already happening, according to the lawyer.

The 1889 Paris Exposition Urban Legend

The 1889 Paris Exposition Urban Legend

Urban legends are definitely not new – and some of the older ones are much better than the ones we have today. Here’s a good one that I encountered via an old time radio play. The story goes like this:

The year was May and the fabulous 1889 Paris Exposition was about to get started. A girl arrived with her mother via ocean liner from India. They checked into the Hotel Crillon but the mother fell sick upon arrival. A doctor was called to help. Shortly after, the daughter was sent on an errand to get some critical medicine, but the coachman and everyone took forever to get her the medicine and get her back to the hotel. When she arrived, she asked for the room key to get the medicine to her mother. At this point the desk clerk, all the hotel staff, and even the doctor claimed the girl arrived alone and there was no mother. Nobody had been sick and other lodgers had been checked into the supposed mother’s room for days. The girl became hysterical and demanded they take her to her mother’s room. They showed her the room her mother was in but it was completely different – with different furniture, window coverings, and a stack of luggage from another set of travelers. The girl ran to the British Embassy who, upon investigation and being given the same story/shown around by the hotel staff, concluded that the girl was probably crazy. She was sent onwards to Britain to an asylum.

What happened to the mother? The legend goes to explain the hotel doctor discovered the mother had bubonic plague. The doctor, hotel staff, and officials quickly realized the gravity of such a diagnosis. With so much riding on the success of the Paris Exposition – fortunes would be lost overnight if panic spread about a plague in the city.

They decided to sent the girl away and told everyone to delay her as much as possible. They then moved the mother to a hidden facility where she died shortly after. They re-decorated the room, destroyed the records, put new people in the room who were in on the plot, and basically did everything possible to cover up the infection and discredit the girl’s story.

Was it true? People have tried to prove it but there’s been no concrete evidence. Still, the story appears to have circulated around the world for years after the 1889 Paris Exposition.

As evidence of this early urban legend’s widespread telling, John Dickson Carr wrote a wildly popular story called Cabin B-13 as a radio play that aired in 1943. Very tame by today’s standards, it takes a twist on the old Paris tale – with the characters even mentioning the tale in their dialog. It’s a great little thriller that was broadcast in the US and then used as the opening set piece for a new thriller series on the BBC. Give it a listen – if you dare!

Link: