A MagicMirrorΒ² module that generates a new AI wallpaper or video every hour based on the current weather, time of day, and month β using Pollinations.ai and the OpenWeatherMap API.
- π€οΈ Weather-aware β fetches live weather and builds the prompt around current conditions
- π Time-of-day aware β sunrise, morning, midday, sunset, dusk, night
- π Month-aware β seasonal modifiers per month (fully customizable)
- π¨ Random style per cycle β picks a random style from your
stylesarray each time - πΌοΈ Image or video β supports both static AI images and short AI-generated videos (
mediaType) - πΎ Downloads & caches locally β always stored as
current_wallpaper.jpg/current_wallpaper.mp4, one file on disk - π Auto-refreshes every hour (configurable)
- π Debug overlay β on-screen panel + console logs when
debug: true
Main subject is the weather: light rain. Time of day: golden hour sunrise, dawn. Image style must be: photorealistic landscape, ultra detailed, 8k. Secondary mood and seasonal context: early spring, first flowers, fresh.
Main subject is the weather: clear sky. Time of day: night, stars, moonlight. Image style must be: anime background art, studio ghibli style, detailed, beautiful. Secondary mood and seasonal context: winter, christmas lights, snow.
- MagicMirrorΒ² installed and running
- A free OpenWeatherMap API key (free tier: 1,000 calls/day)
- A free Pollinations.ai publishable key (
pk_...)
cd ~/MagicMirror/modules
git clone https://github.com/AJOCHAM/MMM-AIWallpaper.git
cd MMM-AIWallpaperNo npm install needed β only built-in Node.js modules are used.
Add to your ~/MagicMirror/config/config.js:
{
module: "MMM-AIWallpaper",
position: "fullscreen_below",
config: {
weatherApiKey: "YOUR_OPENWEATHERMAP_KEY",
pollinationsKey: "YOUR_POLLINATIONS_KEY", // pk_...
city: "Munich",
mediaType: "image", // "image" or "video"
width: 1920,
height: 1080,
imagemodel: "flux",
videomodel: "nova-reel",
videoDuration: 5,
videoAspectRatio: "9:16",
videoAudio: false,
muteVideo: true,
loopVideo: true,
enhance: true,
styles: [
"impressionist painting, oil on canvas, artistic, moody, expressive brushstrokes",
"Comic style, atmospheric, science fiction elements, modern european",
"anime background art, studio ghibli style, detailed, beautiful",
"photorealistic landscape, ultra detailed, 8k"
],
updateInterval: 60 * 60 * 1000, // 1 hour in ms
debug: false,
}
},| Option | Default | Description |
|---|---|---|
weatherApiKey |
"" |
OpenWeatherMap API key (required) |
pollinationsKey |
"" |
Pollinations.ai publishable key pk_... (required) |
city |
"Berlin" |
City for weather lookup |
mediaType |
"video" |
Output type: "image" or "video" |
width |
1080 |
Image width in pixels (image mode only) |
height |
1920 |
Image height in pixels (image mode only) |
imagemodel |
"flux" |
Pollinations image model (e.g. flux, turbo) |
videomodel |
"nova-reel" |
Pollinations video model |
videoDuration |
5 |
Video duration in seconds |
videoAspectRatio |
"9:16" |
Video aspect ratio (e.g. "16:9", "9:16") |
videoAudio |
false |
Include audio in generated video |
muteVideo |
true |
Mute video playback in the browser |
loopVideo |
true |
Loop video playback |
enhance |
true |
Let Pollinations auto-enhance the prompt |
styles |
(see below) | Array of styles; one is picked at random each cycle |
updateInterval |
3600000 |
Refresh interval in ms (default: 1 hour) |
debug |
false |
Show debug overlay and console logs |
monthModifiers |
(see below) | Per-month prompt modifiers |
Each generation cycle picks one style at random from the styles array. You can add as many as you like:
styles: [
// Impressionism / painterly
"Impressionist painting, oil on canvas, luminous light, expressive brushstrokes, Claude Monet inspired",
"Post-impressionist landscape, bold color, textured paint, Vincent van Gogh inspired",
"Romantic landscape painting, dramatic skies, glowing light, Caspar David Friedrich inspired",
// Classical / historic
"Renaissance landscape, balanced composition, soft natural light, Leonardo da Vinci inspired",
"Baroque painting, rich shadows, dramatic contrast, golden highlights, Caravaggio inspired",
"Rococo pastoral scene, elegant, airy, delicate color palette, Jean-Honore Fragonard inspired",
"Ukiyo-e woodblock print, stylized clouds, flowing lines, Hokusai inspired",
"Japanese ink wash painting, minimal brushwork, tranquil atmosphere, sumi-e style",
"Chinese shan shui landscape, misty mountains, poetic, traditional ink painting",
// 19th / early 20th century
"Art Nouveau illustration, ornate organic lines, decorative floral forms, Alphonse Mucha inspired",
"Symbolist dreamscape, mysterious atmosphere, ethereal light, Odilon Redon inspired",
"Fauvist landscape, vivid unnatural color, bold shapes, Henri Matisse inspired",
"Cubist cityscape, fragmented geometry, layered planes, Pablo Picasso inspired",
"Expressionist painting, emotional color, energetic strokes, Wassily Kandinsky inspired",
"Surrealist landscape, strange dream logic, cinematic stillness, Salvador Dali inspired",
// Modern / graphic
"Bauhaus poster style, geometric forms, minimal palette, clean modernist composition",
"Art Deco illustration, elegant symmetry, luxurious metallic accents, 1920s style",
"Mid-century modern illustration, flat shapes, limited palette, retro design",
"Pop art scene, bold outlines, vibrant contrast, Roy Lichtenstein inspired",
"Minimalist Scandinavian landscape, muted tones, clean composition, calm atmosphere",
"Swiss graphic design style, strong layout, minimal forms, refined modern poster aesthetic",
// Contemporary / digital
"Comic style, atmospheric, science fiction elements, modern european graphic novel",
"Anime background art, painterly skies, detailed environment, Studio Ghibli inspired",
"Makoto Shinkai inspired background art, glowing skies, cinematic clouds, vibrant light",
"Photorealistic landscape, ultra detailed, natural lighting, cinematic 8k",
"Hyperreal matte painting, epic scenery, cinematic atmosphere, ultra detailed",
"Low poly landscape art, geometric shapes, stylized lighting, modern digital art",
"Watercolor illustration, soft washes, textured paper, gentle natural palette",
"Gouache painting, matte texture, rich color blocks, editorial illustration style",
"Pastel chalk landscape, soft edges, dreamy atmosphere, textured surface",
"Paper cut collage, layered shapes, handcrafted depth, elegant composition",
"Pixel art landscape, detailed retro scene, atmospheric lighting, 16-bit inspired",
"Synthwave retrofuturism, neon sunset, geometric horizon, 1980s inspired",
"Vaporwave dreamscape, pastel neon palette, surreal architecture, nostalgic digital mood",
"Dark fantasy illustration, moody atmosphere, intricate environment, cinematic detail",
"Nordic folklore illustration, muted winter palette, mysterious forest, storybook style"
],Each month has a default seasonal modifier applied as secondary context to the prompt. You can override any or all of them in your config:
monthModifiers: {
1: "snowy winter, frozen trees, icy",
2: "late winter, bare trees, cold light",
3: "early spring, first flowers, fresh",
4: "spring, cherry blossoms, green meadows",
5: "late spring, colorful flowers, warm sun",
6: "early summer, lush green, golden light",
7: "midsummer, hot haze, vibrant colors",
8: "late summer, sunflowers, harvest beginning",
9: "early autumn, golden leaves, misty mornings",
10: "autumn, red and orange foliage, fog",
11: "late autumn, bare trees, grey skies",
12: "winter, christmas lights, snow",
},You can customize these freely β add specific locations, art styles, moods, or seasonal events:
monthModifiers: {
10: "Halloween, jack-o-lanterns, spooky fog, orange glow",
12: "Christmas Eve, snow, warm window light, cozy village",
}The module automatically selects a time-of-day descriptor based on the current hour:
| Hour | Descriptor |
|---|---|
| 05:00 β 08:59 | golden hour sunrise, dawn |
| 09:00 β 11:59 | bright morning |
| 12:00 β 16:59 | midday |
| 17:00 β 19:59 | sunset, golden hour |
| 20:00 β 20:59 | dusk, twilight, blue hour |
| 21:00 β 04:59 | night, stars, moonlight |
Set debug: true in your config to enable:
- On-screen overlay showing: status, media type, local file path, city, weather, temperature, humidity, daytime, month modifier, model names, seed, last updated time, full prompt, and any errors
- Console logs for every step: weather fetch, prompt build, media URL, download progress, and file save
config: {
debug: true,
// ...
}- On startup and every hour, the module fetches the current weather from OpenWeatherMap
- It picks a random style from the
stylesarray, then combines it with the weather description, current time-of-day, and month modifier to build a prompt - The prompt is sent to Pollinations.ai, which generates a unique image or video
node_helper.jsdownloads the media and saves it locally (overwriting the previous file)- The frontend receives a socket notification and updates the background
Disk usage stays constant at ~1β3 MB for images, or more for video depending on duration.
MMM-AIWallpaper/
βββ MMM-AIWallpaper.js # Frontend module
βββ node_helper.js # Backend: handles file download
βββ MMM-AIWallpaper.css # Fullscreen background + debug overlay styles
βββ current_wallpaper.jpg # Generated at runtime (image mode), not committed
βββ current_wallpaper.mp4 # Generated at runtime (video mode), not committed
βββ README.md
MIT