Stable Diffusion is a powerful AI image generation tool, but it often requires expensive GPUs. This guide will show you how to bypass these limitations using Lightning AI's free cloud platform, allowing you to create stunning AI art without any local hardware or complex setups.
If you're more of a visual learner or simply want to see how it's done, I recommend checking out my YouTube tutorial. It covers everything step-by-step.
Step 1: Set Up Lightning AI Account
- Visit Lightning AI's website and click 'Start Free'.
- Use a professional or educational email for instant access. Personal emails may face a waiting period.
- Once logged in, create a new studio by clicking 'New Studio' and selecting the 'Code' environment.
- Delete the default main.py file in your new studio.
- Rename your studio for easy identification.
Step 2: Install Stable Diffusion WebUI
- Open a new Terminal window in your Lightning AI studio.
- Clone the Stable Diffusion WebUI repository:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
- Modify the 'webui-user.sh' file:
- Prevent creation of a new virtual environment:
venv_dir="-"
- Enable accelerated launch:
export ACCELERATE="True"
- Prevent creation of a new virtual environment:
Step 3: Download Models
- Choose a model from sites like HuggingFace or CivitAI. For example: Juggernaut XL
- Use the following command format to download:
wget -O stable-diffusion-webui/models/Stable-diffusion/MODEL_NAME.safetensors "DOWNLOAD_URL&token=API_TOKEN"
Here's how to break down the command:
MODEL_NAME
is where you'll enter the downloaded file's name, making it easy to recognize later. For example, we could call itJuggernaut_XL
DOWNLOAD_URL
comes from copying the link address of the specific model version's download button on civit.ai by right-clicking and selecting "Copy link address".API_TOKEN
is your unique API key from civit.ai – you might not need this for every model, especially those that can be downloaded without logging in. For models requiring an account, sign up, create an API key under Account Settings > API keys, generate a new one, name it, and you're all set! Keep in mind to safeguard your API key. Once I've completed this tutorial, I'll revoke it straight away.
Step 4: Run Stable Diffusion WebUI
- Switch to GPU mode in your Lightning AI studio.
- Run Stable Diffusion WebUI:
cd stable-diffusion-webui ./webui.sh
- Use the Port Viewer plugin to access the interface.
Bonus: Automate Startup
- Ensure your studio stays in GPU mode by checking "Remember last used machine".
- Edit the "on_start.sh" file to include:
cd stable-diffusion-webui ./webui.sh
Now you can generate AI art using models like Juggernaut XL. Set image dimensions to 1024x1024 pixels, choose a sampler like UniPC, and start creating!
This setup provides a free, powerful AI art studio in the cloud, eliminating the need for expensive hardware or complex local setups. For a quicker start, you can use a pre-configured Stable Diffusion WebUI template on Lightning AI, available through the link in the video description.
Happy creating!
Prompt | Image |
---|---|
lovely double exposure image by blending together a deep gradient background from electric purple to black and a glass sphere. The background should serve as the underlying backdrop, with its subtle, dark tones subtly incorporated into the glossy glass (sphere:1.5). Inside the sphere: vibrant purple lightning strikes, with the lightning bolts frozen in place, giving the impression of a still image. The glass sphere is positioned in the left third of the image, slightly off-center towards the left edge. sharp focus, double exposure, glossy glass (sphere:1.5), (translucent glass figure) (lig) lifeless, dead, intricate design, hyper realistic, high definition, extremely detailed, dark softbox image, raytracing, cinematic, HDR, photorealistic (double exposure:1.1) | |
In the dimly lit, sterile lab, an enigmatic scientist hunches over a glowing screen, her fingers flying across a keyboard in a blur of motion. The photograph captures a futuristic scene, a cinematic snapshot capturing the essence of a post-modern arcane genetic modification lab. The vibrant colors of bio-luminescent tubes and shimmering glass vials contrast with the stark, metallic surroundings, creating an atmosphere of eerie beauty. Every detail is crisp and clear, from the intricate patterns on the scientist's lab coat to the intricate web of circuitry connecting the various machines and devices. This high-quality image pulls viewers into a world where science and magic merge, hinting at a future where genetic manipulation holds both promise and peril. | |
In the dimly lit streets of the neo-victorian vintage-chic parallel universe, a mysterious figure clad in lace and velvet emerges from the shadows, a silver pocket watch hanging from their waistcoat. This scene is captured in a highly detailed and atmospheric photograph, with richly contrasting colors and dramatic lighting that enhances the air of intrigue. The figure's porcelain skin is framed by dark, cascading curls, their eyes gleaming with an enigmatic intensity. The image exudes an unmistakable aura of elegance and sophistication, inviting viewers to unravel the secrets within. | |
A mesmerizing electrifying void voyager, its form dancing with swirling energy and crackling sparks against the stark backdrop of a dark abyss. This concept art piece is a detailed digital painting, showcasing a mysterious being embodying the essence of cosmic power and mystery. The intricate linework and vibrant colors truly make this image pop, inviting viewers to get lost in the enchanting depths of the unknown. | |
A sultry starfighter, her sleek form exuding an air of mystery and allure, captured in the rawness of a street photography snapshot. The image, a stunning and realistic photograph, showcases her unconventional beauty amidst the urban chaos. Her dusky metallic armor glistens under the dim streetlights, reflecting a subtle hint of danger. The intensity in her piercing gaze conveys a story untold, drawing viewers in with its undeniable quality and captivating presence. | |
In the heart of a futuristic city, a magenta-hued cyberpunk street beckons with its neon-lit alleyways and towering holographic billboards. In a stunning photograph, the main subject is a lone figure, cloaked in shadow, standing under a flickering streetlight. The colors are vivid and electrifying, casting an otherworldly glow against the rain-slicked pavement. The intricate details of the cybernetic implants on the figure's face are rendered with breathtaking precision, capturing the essence of a world where technology and humanity converge. Each element of the scene is meticulously crafted, creating an immersive and captivating visual experience that transports the viewer to a world of sleek chrome and pulsating neon. | |
A grotesque Lovecraftian interplanetary ambassador emerges from the shadows, tendrils writhing and tentacles unfurling as it looms over an alien landscape. This concept art is a detailed digital painting, depicting the ambassador in all its monstrous glory. Its twisted form is a chaotic mix of slimy textures, organic shapes, and unearthly colors that seem to shift and pulsate. Every intricate detail is rendered with astonishing realism, creating a sense of eerie familiarity despite its alienness.The overall composition is dynamic and dramatic, drawing the viewer in with its unsettling beauty. |