runwayml/stable-diffusion Updated 2025-07-16
Someone should package this better for end user "just works after Conda install" image generation, it is currently much more of a library setup.
Tested on Amazon EC2 on a g5.xlarge machine, which has an Nvidia A10G, using the AWS Deep Learning Base GPU AMI (Ubuntu 20.04) image.
First install Conda as per Section "Install Conda on Ubuntu", and then just follow the instructions from the README, notably the Reference sampling script section.This took about 2 minutes and generated 6 images under
git clone https://github.com/runwayml/stable-diffusion
cd stable-diffusion/
git checkout 08ab4d326c96854026c4eb3454cd3b02109ee982
conda env create -f environment.yaml
conda activate ldm
mkdir -p models/ldm/stable-diffusion-v1/
wget -O models/ldm/stable-diffusion-v1/model.ckpt https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt
python scripts/txt2img.py --prompt "a photograph of an astronaut riding a horse" --plmsoutputs/txt2img-samples/samples, includining an image outputs/txt2img-samples/grid-0000.png which is a grid montage containing all the six images in one:A quick attempt at removing their useless safety features (watermark and NSFW text filter) is:but that produced 4 black images and only two unfiltered ones. Also likely the lack of sexual training data makes its porn suck, and not in the good way.
diff --git a/scripts/txt2img.py b/scripts/txt2img.py
index 59c16a1..0b8ef25 100644
--- a/scripts/txt2img.py
+++ b/scripts/txt2img.py
@@ -87,10 +87,10 @@ def load_replacement(x):
def check_safety(x_image):
safety_checker_input = safety_feature_extractor(numpy_to_pil(x_image), return_tensors="pt")
x_checked_image, has_nsfw_concept = safety_checker(images=x_image, clip_input=safety_checker_input.pixel_values)
- assert x_checked_image.shape[0] == len(has_nsfw_concept)
- for i in range(len(has_nsfw_concept)):
- if has_nsfw_concept[i]:
- x_checked_image[i] = load_replacement(x_checked_image[i])
+ #assert x_checked_image.shape[0] == len(has_nsfw_concept)
+ #for i in range(len(has_nsfw_concept)):
+ # if has_nsfw_concept[i]:
+ # x_checked_image[i] = load_replacement(x_checked_image[i])
return x_checked_image, has_nsfw_concept
@@ -314,7 +314,7 @@ def main():
for x_sample in x_checked_image_torch:
x_sample = 255. * rearrange(x_sample.cpu().numpy(), 'c h w -> h w c')
img = Image.fromarray(x_sample.astype(np.uint8))
- img = put_watermark(img, wm_encoder)
+ # img = put_watermark(img, wm_encoder)
img.save(os.path.join(sample_path, f"{base_count:05}.png"))
base_count += 1 Forbes Updated 2025-07-16
Type of cloud computing Updated 2025-07-16
Cool data embedded in the Bitcoin blockchain Cute Coinbase messages Updated 2025-07-16
As such most of them tend to be boring ads for mining pools, but there are a few exceptions, especially in the early days.
Nuclear triad Updated 2025-07-16
Nuclear magnetic resonance Updated 2025-07-16
Ciro Santilli once visited the chemistry department of a world leading university, and the chemists there were obsessed with NMR. They had small benchtop NMR machines. They had larger machines. They had a room full of huge machines. They had them in corridors and on desk tops. Chemists really love that stuff. More precisely, these are used for NMR spectroscopy, which helps identify what a sample is made of.
Introduction to NMR by Allery Chemistry
. Source. - only works with an odd number of nucleons
- apply strong magnetic field, this separates the energy of up and down spins. Most spins align with field.
- send radio waves into sample to make nucleons go to upper energy level. We can see that the energy difference is small since we are talking about radio waves, low frequency.
- when nucleon goes back down, it re-emits radio waves, and we detect that. TODO: how do we not get that confused with the input wave, which is presumably at the same frequency? It appears to send pulses, and then wait for the response.
How to Prepare and Run a NMR Sample by University of Bath (2017)
Source. This is a more direct howto, cool to see. Uses a Bruker Corporation 300. They have a robotic arm add-on. Shows spectrum on computer screen at the end. Shame no molecule identification after that!This video has the merit of showing real equipment usage, including sample preparation.
Says clearly that NMR is the most important way to identify organic compounds.
- youtu.be/uNM801B9Y84?t=41 lists some of the most common targets, including hydrogen and carbon-13
- youtu.be/uNM801B9Y84?t=124 ethanol example
- youtu.be/uNM801B9Y84?t=251 they use solvents where all protium is replaced by deuterium to not affect results. Genius.
- youtu.be/uNM801B9Y84?t=354 usually they do 16 radio wave pulses
Introductory NMR & MRI: Video 01 by Magritek (2009)
Source. Precession and Resonance. Precession has a natural frequency for any angle of the wheel.Introductory NMR & MRI: Video 02 by Magritek (2009)
Source. The influence of temperature on spin statistics. At 300K, the number of up and down spins are very similar. As you reduce temperature, we get more and more on lower energy state.Introductory NMR & MRI: Video 03 by Magritek (2009)
Source. The influence of temperature on spin statistics. At 300K, the number of up and down spins are very similar. As you reduce temperature, we get more and more on lower energy state.NMR spectroscopy visualized by ScienceSketch
. Source. 2020. Decent explanation with animation. Could go into a bit more numbers, but OK. Definite matrix Updated 2025-07-16
DEF CON Updated 2025-07-16
Star outside the Milky Way Updated 2025-07-16
With telescopes however, it is possible. www.quora.com/Can-we-distinguish-individual-stars-in-other-galaxies-or-would-it-be-equivalent-to-say-we-know-there-are-other-forests-of-stars-galaxies-but-we-cant-tell-the-individual-trees-stars-What-is-the-farthest-individual/answer/Jerzy-Micha%C5%82-Pawlak contains an amazing answer that mentions two special cases of the furthest ones:
- gravitational lensing observation
- a star that is far but visible because its light is reflected by a nearby nebulae
But what we can definitely see are globular clusters of galaxies. E.g. the article en.wikipedia.org/wiki/Messier_87 basically gauges the size of galaxies by the number of globular clusters that they contain.
Visual math HTML book Updated 2025-07-16
When you see some tagged examples, you will immediately know what this means.
Software developed by Nvidia Updated 2025-07-16
PhysX Updated 2025-07-16
Had hardware acceleration in mind from the very start, and for a long time that has meant GPU acceleration.
Bitcoin mining reward Updated 2025-07-16
Change (Bitcoin) Updated 2025-07-16
Science communicator Updated 2025-07-16
Open access Updated 2025-07-16
Nuclear chain reaction Updated 2025-07-16
Mathematics masters course of the University of Oxford Updated 2025-07-16
nth root Updated 2025-10-14
Decompiler Updated 2025-07-16
Unlisted articles are being shown, click here to show only listed articles.
