Spaces:
Paused
A newer version of the Gradio SDK is available: 6.24.0
title: Pornmaster Krea2
emoji: 🏆
colorFrom: indigo
colorTo: yellow
sdk: gradio
sdk_version: 6.22.0
python_version: '3.12'
app_file: app.py
pinned: false
short_description: Krea 2 PornMaster finetune space.
Pornmaster Krea 2
Krea 2 Turbo text-to-image on Gradio, running the ComfyUI backend directly (no ComfyUI server, no custom nodes). Deploy on ZeroGPU hardware.
Workflow: image_krea2_turbo_t2i.json
Pattern: Run ComfyUI workflows for free with Gradio on Hugging Face Spaces
How it works
app.pyclones the ComfyUI backend (once), downloads the models, loads them at module scope, and runs the flattened workflow via direct node calls insidegenerate_image(), decorated with@spaces.GPU.- UNet (diffusion model) comes from CivitAI: PornMaster-Krea2 (model 2735032, version V2.5 Turbo / 3171380, fp8). Companion models (text encoder, VAE, LoRA) come from Comfy-Org/Krea-2, which is not gated.
CivitAI version ladder
V2.5 (3171380) is currently Early Access on CivitAI (needs Buzz to unlock), so the app automatically tries, in order:
CIVIT_MODEL_VERSION(default3171380, V2.5 Turbo fp8)CIVIT_FALLBACK_VERSION(default3112108, Turbo V2 FP8) - downloads fine today- Stock
krea2_turbo_fp8_scaled.safetensorsfrom Comfy-Org (last resort)
Once V2.5 is unlocked on the CivitAI account, it is used automatically (no code
change needed). Set CIVIT_MODEL_VERSION=3112108 on the Space to force V2.
Setup
- Create a Space with Gradio SDK (already configured in this repo).
- Set hardware to ZeroGPU (
largeis fine). ZeroGPU PRO or grant required. - Add the CivitAI API key as a Space secret named
CIVIT_API_KEY. - First cold start downloads ~17.4 GB of models (5-10 min) and clones ComfyUI. After that, ZeroGPU keeps the container disk, so resumes are fast.
Notes / tuning
duration:@spaces.GPU(duration=120). Measure worst-case wall time and setduration = measured * 1.4. LLM prompt enhancement adds 20-60 s.- ZeroGPU sizing:
size="large"is the default (48 GB VRAM slice on Blackwell). Only switch toxlarge(2x quota) if it OOMs. - Return values: numpy arrays are returned (never CUDA tensors), required across the ZeroGPU fork boundary.
- No HF token needed: none of the model repos are gated.
Why ComfyUI and not diffusers
Diffusers does have a Krea2Pipeline, but the official diffusers-format repos
(krea/Krea-2-Turbo) are gated and 26 GB bf16, and there is no tooling to load
raw CivitAI state dicts (single-file checkpoints) with diffusers for Krea 2.
The ComfyUI backend loads the CivitAI .safetensors directly via UNETLoader
with automatic architecture detection, and Krea 2 LoRAs work natively.