Spaces:
Running
Running
Download index.html from SimonHWu2026/Topic6APIG: direct link, hf CLI and curl.
- Browser
- Download file 19 kB
-
https://huggingface.co/spaces/SimonHWu2026/Topic6APIG/resolve/main/index.html
- Command line
-
hf download hf://spaces/SimonHWu2026/Topic6APIG/index.html
-
curl -L -o index.html https://huggingface.co/spaces/SimonHWu2026/Topic6APIG/resolve/main/index.html
19 kB
| <html lang="en" data-wr92-course="lab"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width,initial-scale=1"> | |
| <meta name="description" content="Learn three diffusion architectures and design fair seed and prompt experiments. Free static classroom lab."> | |
| <title>AI Image Generation · Student Lab</title> | |
| <link rel="stylesheet" href="./style.css"> | |
| <script type="module" src="./app.js"></script> | |
| <style id="wr92-shared-classroom-nav"> | |
| .wr92-course-nav{max-width:1160px;margin:12px auto 0;padding:16px 18px;border:1px solid #dce4f0;border-radius:16px;background:#f8fbff;color:#243047;font-family:system-ui,-apple-system,sans-serif;line-height:1.5} | |
| .wr92-course-nav strong{font-size:0.97rem} | |
| .wr92-course-nav .wr92-nav-row{display:flex;flex-wrap:wrap;gap:8px;margin:9px 0 12px} | |
| .wr92-course-nav a{display:inline-block;padding:7px 10px;border:1px solid #dae2ee;border-radius:9px;background:#fff;color:#1644a3;text-decoration:none;font-size:0.84rem} | |
| .wr92-course-nav a:hover,.wr92-course-nav a:focus-visible{background:#e6efff;text-decoration:underline} | |
| .wr92-course-nav a[aria-current="page"]{border-color:#3d70d2;background:#eaf1ff;font-weight:700} | |
| .wr92-course-nav p{font-size:0.88rem;margin:5px 0;color:#405169} | |
| .wr92-course-nav .wr92-cap{border-top:1px solid #dce4f0;padding-top:10px} | |
| </style> | |
| <link rel="stylesheet" href="./wr92-language.css"> | |
| <script defer src="./wr92-language.js"></script> | |
| </head> | |
| <body> | |
| <div class="wr92-language-toolbar" role="group" aria-label="Language / 语言"> | |
| <button type="button" data-wr92-lang="en" aria-pressed="true" disabled>EN</button> | |
| <button type="button" data-wr92-lang="zh" aria-pressed="false" disabled>中文</button> | |
| </div> | |
| <div class="topline"></div> | |
| <header class="masthead wrap"> | |
| <a class="wordmark" href="#top"><span class="mark" aria-hidden="true">✦</span> Creative Technology <span class="muted">/ Image Generation</span></a> | |
| <nav aria-label="Course navigation"> | |
| <a href="#models">Architectures</a> | |
| <a href="#lab">Experiment Lab</a> | |
| <a href="#assignment">Project</a> | |
| <a class="nav-outline" href="https://huggingface.co/spaces/wr92-course/test" rel="noopener noreferrer">Object Detection ↗</a> | |
| </nav> | |
| </header> | |
| <main id="top"> | |
| <section class="wr92-course-nav" aria-label="WR92 Course links and usage limits"><strong>WR92 Course · Related learning spaces</strong><nav class="wr92-nav-row" aria-label="Switch between course demos"><a href="https://huggingface.co/spaces/wr92-course/README" target="_top" rel="noopener noreferrer">WR92 Course</a><a href="https://huggingface.co/spaces/wr92-course/test" target="_top" rel="noopener noreferrer">Object Detection</a><a href="https://huggingface.co/spaces/wr92-course/image-generation-lab" target="_top" rel="noopener noreferrer" aria-current="page">Image Generation Lab</a><a href="https://huggingface.co/spaces/miyuki17/creative-technology-image-generation" target="_top" rel="noopener noreferrer">SDXL Turbo · GPU</a><a href="https://huggingface.co/spaces/miyuki17/creative-technology-sana-sprint" target="_top" rel="noopener noreferrer">SANA-Sprint · GPU</a></nav><div class="wr92-cap"><strong>No Hugging Face GPU used here</strong><p>Reading, viewing genuine saved images and building an experiment plan need no Hugging Face ZeroGPU. Therefore no ZeroGPU minute/call quota applies to these page actions. To generate a NEW image, use the optional live Spaces: signed-in Free 5 GPU min/day, anonymous 2 GPU min/day; reset 24h after first use; number of requests is not guaranteed. <a href="https://huggingface.co/docs/hub/spaces-zerogpu" target="_blank" rel="noopener noreferrer">HF ZeroGPU policy ↗</a></p></div></section> | |
| <section class="hero wrap"> | |
| <div class="hero-copy"> | |
| <p class="eyebrow">AI-POWERED COMPUTER VISION · STUDENT COURSE</p> | |
| <h1>From random noise<br>to <em>your own image.</em></h1> | |
| <p class="hero-lede">Learn how three different diffusion architectures generate images. Design experiments with seeds and prompts — and build an AI project of your own.</p> | |
| <div class="hero-actions"><a class="primary" href="#lab">Try the learning lab <span aria-hidden="true">→</span></a><a class="secondary" href="#models">Understand the models</a></div> | |
| <p class="fine">Free teaching page. This version prepares experiments and shows three genuine saved images; <strong>it does not itself perform GPU generation.</strong></p> | |
| </div> | |
| <div class="hero-illustration" aria-label="Illustration of input noise, a denoising network and an image"> | |
| <div class="mini-tag">How diffusion works</div> | |
| <div class="pipeline"> | |
| <div class="mini-noise" aria-label="Stylized random noise"></div> | |
| <span class="pipe-arrow">→</span> | |
| <div class="network" aria-label="Neural network">AI</div> | |
| <span class="pipe-arrow">→</span> | |
| <div class="mini-photo" aria-label="Illustrative teapot silhouette">◕</div> | |
| </div> | |
| <p>Noise → denoising → image</p> | |
| <small>Concept illustration only · not a model output</small> | |
| </div> | |
| </section> | |
| <section class="model-area" id="models"> | |
| <div class="wrap"> | |
| <p class="eyebrow">01 / THE TECHNOLOGY</p> | |
| <h2>Three distinct ways to diffuse.</h2> | |
| <p class="section-lede">The models share the idea of gradual denoising, but differ in where and how the network operates. They are <strong>not</strong> an identical-prompt image quality contest.</p> | |
| <div class="architecture-grid"> | |
| <article class="architecture-card"> | |
| <div class="card-index">01 · PIXEL SPACE</div> | |
| <img src="./figures/ddpm.svg" alt="DDPM: pixel noise, iterative U-Net denoising, tiny pixel image" loading="lazy"> | |
| <h3>DDPM</h3> | |
| <p>Works on image pixels. Start with random noise and gradually remove it. Our 32×32 CIFAR-10 example is <strong>unconditional</strong>: it has no text prompt input.</p> | |
| <div class="links"><a href="https://arxiv.org/abs/2006.11239" rel="noopener noreferrer" target="_blank">Original paper ↗</a><a href="https://huggingface.co/google/ddpm-cifar10-32" rel="noopener noreferrer" target="_blank">Model ↗</a></div> | |
| </article> | |
| <article class="architecture-card"> | |
| <div class="card-index">02 · LATENT SPACE / U-NET</div> | |
| <img src="./figures/ldm.svg" alt="Latent diffusion: text encoding and latent U-Net denoising followed by VAE decoding" loading="lazy"> | |
| <h3>SDXL Turbo</h3> | |
| <p>Generates in a compressed image space using a U-Net, then decodes it to pixels. Distillation makes it possible to use very few inference steps.</p> | |
| <div class="links"><a href="https://arxiv.org/abs/2112.10752" rel="noopener noreferrer" target="_blank">Architecture paper ↗</a><a href="https://huggingface.co/stabilityai/sdxl-turbo" rel="noopener noreferrer" target="_blank">Model ↗</a></div> | |
| </article> | |
| <article class="architecture-card"> | |
| <div class="card-index">03 · LATENT SPACE / LINEAR DIT</div> | |
| <img src="./figures/sana.svg" alt="SANA-Sprint: text features and compressed latent input processed by a linear diffusion Transformer before decoding" loading="lazy"> | |
| <h3>SANA-Sprint</h3> | |
| <p>Uses a Transformer backbone rather than a U-Net. SANA compresses latent representations and uses efficient attention; Sprint reduces sampling steps.</p> | |
| <div class="links"><a href="https://arxiv.org/abs/2410.10629" rel="noopener noreferrer" target="_blank">Architecture paper ↗</a><a href="https://huggingface.co/Efficient-Large-Model/Sana_Sprint_0.6B_1024px_diffusers" rel="noopener noreferrer" target="_blank">Model ↗</a></div> | |
| </article> | |
| </div> | |
| <p class="fine cite-note">Fast-model extension papers: <a href="https://arxiv.org/abs/2311.17042">SDXL Turbo (ADD)</a> · <a href="https://arxiv.org/abs/2503.09641">SANA-Sprint</a>. Concept figures are our own simplified teaching diagrams.</p> | |
| </div> | |
| </section> | |
| <section class="wrap ddpm-proof" id="ddpm-proof"> | |
| <p class="eyebrow">REAL PIXEL-SPACE MODEL OUTPUTS · NO GPU</p> | |
| <h2>Same DDPM, two different seeds.</h2> | |
| <p class="section-lede">These are two genuine 32×32 outputs from the unconditional DDPM checkpoint at 50 steps, generated on CPU. There is <strong>no text prompt</strong> for this model; only the seed changes.</p> | |
| <div class="ddpm-proof-grid"> | |
| <figure> | |
| <img src="./examples/ddpm_seed2026_50steps.png" width="32" height="32" loading="lazy" alt="Authentic unconditional CIFAR DDPM output generated with seed 2026"> | |
| <figcaption>Seed 2026 · 50 steps · <a href="./examples/ddpm_seed2026_50steps.receipt.json">SHA-256 receipt ↗</a></figcaption> | |
| </figure> | |
| <figure> | |
| <img src="./examples/ddpm_seed2027_50steps.png" width="32" height="32" loading="lazy" alt="Authentic unconditional CIFAR DDPM output generated with seed 2027"> | |
| <figcaption>Seed 2027 · 50 steps · <a href="./examples/ddpm_seed2027_50steps.receipt.json">SHA-256 receipt ↗</a></figcaption> | |
| </figure> | |
| <div> | |
| <h3>What changed?</h3> | |
| <p>Model, revision, resolution and 50-step setting stayed fixed. Only the seed changed. The images are real samples, unlike the input-noise preview further down this page.</p> | |
| <p class="fine">If you want another architecture to explore, the authors host an <a href="https://huggingface.co/spaces/Efficient-Large-Model/SanaSprint" rel="noopener noreferrer">external SANA-Sprint demonstration ↗</a>. Its availability and quota are managed by the original authors, not by this course.</p> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="wrap sample-area" id="sample"> | |
| <p class="eyebrow">REAL DIFFUSION OUTPUTS · IDENTICAL MODEL SETTINGS</p> | |
| <h2>One teapot. Three real generations.</h2> | |
| <p class="section-lede">These are three <strong>actual</strong> SDXL Turbo outputs, generated on our free ZeroGPU service. We fixed model revision, random seed and sampling settings; only the text prompt changes. Viewing these saved results does not use GPU time.</p> | |
| <div class="prompt-staircase-gallery" aria-label="Three genuine teapot outputs with exact parameters"> | |
| <figure> | |
| <img src="./examples/teapot_staircase/01_a_teapot.webp" width="512" height="512" loading="lazy" alt="Actual generation from 'A teapot': pale green floral teapot with gold trim"> | |
| <figcaption><strong>01 · A teapot</strong><span>Seed 2026 · 2 steps</span><a href="./examples/teapot_staircase/01_a_teapot.receipt.json">Image SHA-256 / source ↗</a></figcaption> | |
| </figure> | |
| <figure> | |
| <img src="./examples/teapot_staircase/02_a_red_teapot.webp" width="512" height="512" loading="lazy" alt="Actual generation from 'A red teapot': glossy red teapot"> | |
| <figcaption><strong>02 · A red teapot</strong><span>Seed 2026 · 2 steps</span><a href="./examples/teapot_staircase/02_a_red_teapot.receipt.json">Image SHA-256 / source ↗</a></figcaption> | |
| </figure> | |
| <figure> | |
| <img src="./examples/teapot_staircase/03_a_red_ceramic_teapot.webp" width="512" height="512" loading="lazy" alt="Actual generation from 'A red ceramic teapot' using SDXL Turbo"> | |
| <figcaption><strong>03 · A red ceramic teapot</strong><span>Seed 2026 · 2 steps</span><a href="./examples/teapot_staircase/03_a_red_ceramic_teapot.receipt.json">Image SHA-256 / source ↗</a></figcaption> | |
| </figure> | |
| </div> | |
| <div class="gallery-proof"> | |
| <h3>Why is this a controlled experiment?</h3> | |
| <p><strong>Only change:</strong> the prompt. <strong>Fixed:</strong> SDXL Turbo revision <code>71153311...</code>, seed 2026, two denoising steps, 512×512, guidance 0.0. Each file is a real GPU result served as WebP by Gradio, with its own exact WebP hash and original PNG hash.</p> | |
| <p class="fine">A fixed seed does not guarantee bit-for-bit identity across software or device changes. This comparison is about visible effects of added words, not a claim of perfect prompt adherence. Do not confuse these outputs with the input-noise visualization below.</p> | |
| </div> | |
| </section> | |
| <section class="wrap lab-area" id="lab"> | |
| <p class="eyebrow">02 / HANDS-ON EXPERIMENT DESIGN</p> | |
| <h2>Change one thing. Observe one difference.</h2> | |
| <p class="section-lede">Build a reproducible experiment first. The noise preview shows the <strong>random input only</strong>, not a model-generated picture. Real-time GPU image generation is a separate component.</p> | |
| <div class="lab-grid"> | |
| <form id="lab-form" class="panel" autocomplete="off"> | |
| <label for="model">Model</label> | |
| <select id="model" name="model"> | |
| <option value="sdxl">SDXL Turbo — text to image</option> | |
| <option value="sana">SANA-Sprint — text to image</option> | |
| <option value="ddpm">DDPM — unconditional pixels</option> | |
| </select> | |
| <p id="model-description" class="input-help"></p> | |
| <label for="mode">Experiment</label> | |
| <select id="mode" name="mode"> | |
| <option value="prompt">Gradually add prompt details</option> | |
| <option value="seed">Change only the random seed</option> | |
| <option value="refine">Compare two prompt descriptions</option> | |
| </select> | |
| <div class="form-row"> | |
| <div><label for="seed">Random seed</label><input id="seed" name="seed" type="number" min="0" max="2147483647" step="1" value="2026" required></div> | |
| <button type="button" id="next-seed" class="subtle-button" title="Increase the seed by one">Seed +1</button> | |
| </div> | |
| <div id="prompt-fields"> | |
| <label for="prompt">Base prompt <span class="muted">(English)</span></label> | |
| <textarea id="prompt" name="prompt" rows="2" maxlength="350">A teapot</textarea> | |
| <p class="input-help">Try the prompt staircase:</p> | |
| <div class="prompt-buttons" role="group" aria-label="Example text prompts"> | |
| <button type="button" data-prompt="A teapot">A teapot</button> | |
| <button type="button" data-prompt="A red teapot">+ red</button> | |
| <button type="button" data-prompt="A red ceramic teapot">+ ceramic</button> | |
| </div> | |
| <div id="alt-field"><label for="alternative">Alternative prompt</label><textarea id="alternative" name="alternative" rows="2" maxlength="350">A red ceramic teapot on a wooden table</textarea></div> | |
| </div> | |
| <button class="primary full" type="submit">Build experiment plan →</button> | |
| <p id="feedback" class="input-help" role="status" aria-live="polite">No GPU is used for this planning step.</p> | |
| </form> | |
| <div class="result-area"> | |
| <div class="noise-panel panel"> | |
| <div class="panel-heading"><h3>Seed → input noise</h3><span class="tiny-badge">Learning visualization</span></div> | |
| <div class="noise-preview"><canvas width="96" height="96" id="noise-canvas" role="img" aria-label="Deterministic grayscale pseudo-random seed noise; not a generated image"></canvas></div> | |
| <p class="fine">Only a deterministic pseudo-random noise illustration. It does <strong>not</strong> represent DDPM/SDXL/SANA inference or actual model outputs.</p> | |
| </div> | |
| <div class="plan-panel panel"> | |
| <div class="panel-heading"><h3>Experiment plan</h3><button type="button" id="copy-plan" class="text-button" disabled>Copy JSON <span aria-hidden="true">↗</span></button></div> | |
| <pre id="plan-output" tabindex="0">Select parameters, then build a plan.</pre> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="inference-area"> | |
| <div class="wrap inference-grid"> | |
| <div><p class="eyebrow">03 / GENERATE REAL IMAGES</p><h2>When it's time to generate.</h2><p>The model runs in a separate Gradio + ZeroGPU service, which has successfully produced real sample images. Its shared free quota can limit repeated classroom requests. Saved examples in this static course never consume GPU time.</p></div> | |
| <div class="inference-status" id="inference-status" role="status"><span class="dot" aria-hidden="true"></span><strong>Real generation is hosted separately on free ZeroGPU.</strong><small>Single-image inference was verified, but classroom-scale quotas and concurrency remain untested.</small><a class="secondary" href="https://huggingface.co/spaces/miyuki17/creative-technology-image-generation" rel="noopener noreferrer">Try the GPU demo ↗</a></div> | |
| </div> | |
| </section> | |
| <section class="wrap assignment" id="assignment"> | |
| <p class="eyebrow">04 / YOUR CREATIVE PROJECT</p> | |
| <h2>A small change is enough to begin.<br><em>A meaningful application goes further.</em></h2> | |
| <p class="section-lede">Four discrete grades, out of 100. The teacher evaluates the strongest level supported by actual evidence: <strong>60 / 75 / 85 / 95</strong>.</p> | |
| <div class="assignment-grid four-band-rubric" aria-label="Four student project grading levels: 60, 75, 85 and 95"> | |
| <article><span class="score-anchor score-60">60</span><h3>Reproduce and modify</h3><p>Run a published Space, make one genuine small change, and explain inputs, outputs, model, one test and one limitation.</p></article> | |
| <article><span class="score-anchor score-75">75</span><h3>Make it better</h3><p>Add a useful feature or workflow improvement; test before and after, and explain the difference.</p></article> | |
| <article><span class="score-anchor score-85">85</span><h3>Build a real application</h3><p>Solve a specific user's real problem with a complete workflow and relevant evaluations.</p></article> | |
| <article><span class="score-anchor score-95">95</span><h3>Create and validate</h3><p>Show independent creativity, thoughtful AI integration, meaningful value and stronger testing.</p></article> | |
| </div> | |
| <a class="secondary" href="https://huggingface.co/spaces/wr92-course/test/how-to-start.html" rel="noopener noreferrer">How to make your own Hugging Face Space ↗</a> | |
| <p class="fine">These are four score bands, not four weighted percentages. No paid GPU or model training is required for a passing score. Simply repeating our Object Detection + Image Generation combination is not an original bonus idea.</p> | |
| </section> | |
| </main> | |
| <footer class="wrap"><span>Creative Technology · Image Generation Student Lab</span><a href="https://huggingface.co/spaces/wr92-course/test" rel="noopener noreferrer">Original Object Detection demo ↗</a></footer> | |
| </body> | |
| </html> | |