# -*- coding: utf-8 -*- """StableDiffusion_HFokJan25_v1.ipynb # Setup Stable diffusion (HuggingFace style) image generators. Most taken from https://huggingface.co/docs/diffusers/v0.14.0/en/stable_diffusion (c) Gabriel Turinici 2025 """ #nvidia-smi#this only work when cuda is enabled ... #!pip install diffusers[torch]==0.11.1 transformers scipy ftfy accelerate !pip install diffusers[torch] transformers scipy ftfy accelerate """# Load the model Through-out the notebook, we will focus on [https://huggingface.co/runwayml/stable-diffusion-v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5): """ model_id = "runwayml/stable-diffusion-v1-5" """# Construct pipeline""" #Faster with less precision from diffusers import StableDiffusionPipeline import torch pipe16 = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) pipe16 = pipe16.to("cuda")#move to GPU !! prompt="snowy wheather in Paris"#prompt to generate the image image = pipe16(prompt).images[0] image #adjust steps image3 = pipe2(prompt, num_inference_steps=20).images[0] image3