Surprise Me!

Free AI Image-to-Image: Running Stable Diffusion on Google Colab

2026-05-18 65 Dailymotion

Don't have a powerful local GPU? You can still use the advanced "Image-to-Image" (img2img) capabilities of Stable Diffusion for free using Google Colab.<br /><br />In this tutorial, I show you how to set up an img2img workflow in Colab, from connecting to a T4 GPU instance to uploading your source images and applying changes via prompts. Whether you want to turn sketches into realistic art, change clothing colors, or alter expressions, this guide walks you through the settings—including the critical "denoising strength"—to help you get the best results without needing high-end hardware.<br /><br />Google Colab: https://colab.research.google.com/<br />Script Code1:<br />!pip install diffusers["torch"] transformers<br />!pip install accelerate<br />!pip install git+https://github.com/huggingface/diffusers<br /><br />Script Code2:<br />import torch<br />from diffusers import AutoPipelineForImage2Image<br />from diffusers.utils import load_image, make_image_grid<br /><br /><br />init_image = load_image("/content/9.png")<br />mymodel = "digiplay/Realisian_v5"<br />myprompt="Cat Head, male"<br />mynegative_prompt = ""<br />myheight=512<br />mywidth=768<br />mysteps=25<br />myguidance_scale = 7.5<br />mystrength=0.7<br /><br />pipeline = AutoPipelineForImage2Image.from_pretrained(<br /> mymodel, torch_dtype=torch.float16, variant="fp16", use_safetensors=True<br />).to("cuda")<br />pipeline.safety_checker = None<br /><br />image1 = pipeline(<br /> prompt=myprompt,<br /> image=init_image,<br /> negative_prompt=mynegative_prompt,<br /> height=myheight, width=mywidth,<br /> num_inference_step=mysteps,<br /> guidance_scale = myguidance_scale,<br /> strength=mystrength,<br />).images[0]<br />image1<br />make_image_grid([init_image, image1], rows=1, cols=2)<br /><br />How to do text 2 image stable diffusion in Google Colab: https://www.dailymotion.com/video/xa7wtw2<br /><br />Original YouTube Tutorial: https://youtu.be/tWdYwuFryFs<br /><br />Video Details:<br />* Original Publish Date: March 27, 2024<br />* Focus: Image-to-Image / Google Colab / Stable Diffusion Workflow<br />* Test using RTX 4060 TI 16 GB of VRAM<br /><br />Follow lordcaocao2025 on Dailymotion for more technical AI research and generative workflow guides!<br /><br />---<br />Connect with me:<br />📺 YouTube: https://www.youtube.com/@CaoCao2025<br />📱 TikTok: https://www.tiktok.com/@caocao20250<br />💎 Patreon: https://www.patreon.com/cw/Caocao2025<br /><br />#StableDiffusion #GoogleColab #img2img #AIArt #FreeTools #AITutorial #lordcaocao2025

Buy Now on CodeCanyon