Instructions to use sujithputta/Lumaforge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use sujithputta/Lumaforge with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("sujithputta/Lumaforge") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
π LumaForge AuraGen: Latent Diffusion & Fine-Tuning API Engine
This is the self-contained backend API engine for LumaForge AuraGen, designed to be deployed directly to Hugging Face Spaces (Docker or Python API spaces). It provides endpoints for Text-to-Image generation, Image-to-Image styling, 2x upscaling, background removal, dataset curation, and LoRA fine-tuning telemetry.
π Hugging Face Space Deployment
Hugging Face Spaces automatically detect configuration metadata from the YAML frontmatter at the top of this file.
Option A: Docker Space (Recommended)
This folder is configured to run on port 7860 (the default Hugging Face Space port). You can create a Hugging Face space using the Docker SDK and push the contents of the model/ directory along with a standard Dockerfile:
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies for Pillow and image processing
RUN apt-get update && apt-get install -y \
build-essential \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 7860
# Run FastAPI server
CMD ["python", "app.py"]
Option B: FastAPI Space
Create a Hugging Face space with the FastAPI SDK, selecting Python 3.10, and copy the contents of the model/ directory. Hugging Face will automatically recognize app.py as the entrypoint.
π‘ API Endpoints Reference
1. System Status
GET /api/status- Returns device specs (Metal MPS vs CPU) and local Ollama server connectivity logs.
2. Text-to-Image Generation
POST /api/generate- Payload:
{ "prompt": "studio ghibli street", "mode": "general | poster | character", "aspect_ratio": "1:1 | 16:9 | 9:16 | 4:3 | 3:4", "steps": 20, "guidance_scale": 7.5, "seed": -1, "mock": false } - Actions: Checks text safety boundaries (Ollama client),ιι expands prompts structurally, runs latent diffusion on MPS, watermarks the result with the LumaForge logo, and returns the image as a Base64 string.
- Payload:
3. Image-to-Image Stylization
POST /api/generate-img2img- Payload:
{ "prompt": "Convert this photo into anime illustration", "image_b64": "data:image/png;base64,...", "strength": 0.32, "mode": "general", "steps": 20, "guidance_scale": 7.5, "seed": -1, "mock": false } - Actions: Styles the input image using shared pipeline weights. Caps strength to
0.32and applies a Radial Face Protection Mask to preserve original facial structure and details with pixel-level accuracy.
- Payload:
4. High-Fidelity 2x Upscaling
POST /api/upscale- Payload:
{ "image_b64": "data:image/png;base64,...", "scale_factor": 2.0, "mock": false } - Actions: Doubles the resolution of the image using high-quality Lanczos interpolation and sharpens details using an Unsharp Mask.
- Payload:
5. Transparent Background Removal
POST /api/remove-background- Payload:
{ "image_b64": "data:image/png;base64,...", "mock": false } - Actions: Isolates the foreground subject. Uses
rembgif available, falling back to a vectorized NumPy color-threshold algorithm featuring linear alpha feathering to prevent jagged edges.
- Payload:
6. Model Training Telemetry
POST /api/train: Triggers PyTorch UNet LoRA layer fine-tuning on a background thread.GET /api/train/status: Returns live telemetry logs (epoch progress, validation loss metrics, prompt adherence).
7. Dataset Curation & Benchmarking
POST /api/curate: Curates and captions images.POST /api/benchmark: Evaluates pipeline adherence, processing latency, and VRAM footprints.
β‘ Performance Optimizations
- Attention Slicing: Pipeline memory slicing allows Stable Diffusion to run on standard consumer MPS buffers without out-of-memory errors.
- Vectorized Processing: Replaced slow pixel iteration loops with fast vectorized NumPy operations, reducing processing latencies (Sketch generation to 4ms, Background removal to 8ms).
- Token-Bucket Rate Limiters: Restricts API calls to prevent client flooding (10 generations/min, 60 general api calls/min).
- Downloads last month
- -
Model tree for sujithputta/Lumaforge
Base model
stable-diffusion-v1-5/stable-diffusion-v1-5