Objective
This lab introduces students to generative AI in the visual domain through the use of Stable Diffusion, a powerful text-to-image model. Students will interact with a WebUI hosted via Docker on the Jetson Orin Nano and learn how prompt engineering and hyperparameter tuning affect the quality and diversity of generated images.
Learning Outcomes
- Understand the architecture and operational pipeline of Stable Diffusion.
- Generate images from text prompts using various sampling methods and model configurations.
- Analyze the effect of parameters such as sampling method, CFG scale, batch size, and seed value.
- Develop prompt engineering skills to influence image quality and structure.
Lab Tasks
- Environment Setup: Pull and launch the Docker container dustynv/stable-diffusion-webui:r36.2.0. The UI is hosted locally on http://0.0.0.0:7860.
- Basic Prompt Execution: Start with a fixed prompt (e.g., \An orange cat wearing a cowboy hat") and generate base output.
- Hyperparameter Tuning:
- Experiment with 3 different sampling methods and analyze qualitative differences.
- Vary sampling steps (e.g., 10, 50, 150) and observe changes in resolution and detail.
- Adjust CFG Scale to influence prompt adherence.
- Test different batch count and size combinations to study their impact on diversity.
- Use different seed values and compare outputs to evaluate randomness and reproducibility.
- Documentation: Capture and annotate screenshots to record parameter effects and insights.
Expected Deliverables
- Image outputs from all test configurations.
- Short report on Stable Diffusion architecture and prompt-performance relationships.
- Summary of findings from hyperparameter variations.
Part II: Interactive Language Modeling with TinyLLaMA
Objective
This lab explores the application of Large Language Models (LLMs) for real-time, prompt-based natural language generation. Students will run a lightweight LLM—TinyLLaMA—within a WebUI hosted via Docker, and investigate the role of different hyperparameters in shaping output quality and coherence.
Learning Outcomes
- Understand the workflow for deploying and interacting with LLMs locally on edge devices.
- Learn about decoding strategies and hyperparameters that control generation style, fluency, and creativity
- Evaluate and compare outputs across different parameter settings.
Lab Tasks
- Model Setup: Pull and launch the Docker container dustynv/text-generation-webui:r36.2.0. Use the terminal-generated local URL to open the WebUI.
- Model Download and Load: Use the WebUI interface to download the model TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF and load the quantized model file tinyllama-1.1b-chat-v1.0.Q3_K_M.gguf.
- Prompt Execution: Start with a base prompt (e.g., \Tell me what you know about New Jersey Institute
of Technology") and run inference.
- Parameter Exploration: Vary at least 3 values for each of the 10 hyperparameters available in the WebUI (e.g.,
temperature, top-p, top-k, repetition penalty).
- Output Analysis: Record changes in response length, creativity, hallucination, and repetition under different parameter settings.
Expected Deliverables
- Screenshots of outputs for each parameter setting (minimum 30 examples).
- Concise write-up on the TinyLLaMA architecture and inference control strategies.
- Comparative analysis of hyperparameter effects on generation quality.