skiptracer1/krea-2-turbo-studio
Krea 2 Turbo Studio
A focused, mobile-friendly image generation demo using the actual `krea/Krea-2-Turbo` weights.
If the HF_TOKEN secret is missing, the interface explicitly shows Model authorization pending and disables generation. This setup state is not a working inference demo. Adding a valid, model-authorized read token restarts the Space and enables model loading.
Features: prompt presets, five exact aspect ratios, 4–12 denoising steps, reusable seeds, PNG downloads, copyable JSON generation settings, output screening, a queued API, and MCP access. The default is 1024 × 1024 with 8 steps and guidance scale 0.0, following the model author's Turbo example.
Deploy to Hugging Face
The intended Space ID is skiptracer1/krea-2-turbo-studio.
- Sign in with the current
hfCLI:hf auth login. - Request/confirm access on the Krea model page. The account whose token downloads the model must have accepted its terms.
- Create a fine-grained read token with access to that gated model and provide it as the
KREA_MODEL_READ_TOKENenvironment variable. Never put tokens in code, README files, shell history, or chat messages. - From this folder, run:
python deploy.py --repo-id skiptracer1/krea-2-turbo-studioThe script checks authentication, confirms gated-file access, creates a Gradio Space on ZeroGPU, stores only the model-read token as a Space secret, and uploads an explicit allowlist of application files. It will not replace an existing Space unless --update-existing is supplied. It never selects paid dedicated GPU hardware. --private makes a new Space private.
The deployment script requires huggingface_hub (provided with the hf CLI's Python environment). If the CLI was installed with the official Linux installer, use ~/.hf-cli/venv/bin/python deploy.py ....
Alternatively, create a Gradio Space with ZeroGPU in the Hugging Face UI, add a model-authorized read token to Settings → Secrets → HF_TOKEN, set the variable GRADIO_SSR_MODE=false, and upload app.py, config.py, style.css, requirements.txt, and this README together.
ZeroGPU hosting eligibility and visitor quotas are controlled by Hugging Face. Check the current ZeroGPU documentation. If the account is ineligible or out of slots, deployment stops rather than switching to paid hardware.
Live verification
After the build completes, verify all of these on the actual Space:
- Runtime is running on
zero-a10g; logs show both models loaded. - Generate the fox prompt at 1024 × 1024, 8 steps, fixed seed 42.
- Inspect the downloaded PNG and verify the dimensions and reported seed.
- Try a portrait and a wide render; reuse a fixed seed to check repeatability.
- Verify empty prompts are rejected, downloads work, and mobile controls fit.
- Confirm queue and filter failures show actionable messages.
from gradio_client import Client
client = Client("skiptracer1/krea-2-turbo-studio")
client.view_api() # Discover the actual schema before invoking it.
result = client.predict(
prompt="A red fox sitting in fresh snow, golden hour, photorealistic.",
image_format="Square · 1:1",
seed=42,
randomize_seed=False,
steps=8,
api_name="/generate",
)
print(result)The initial GPU reservation follows the official demo's step/area estimate with a screening allowance; it has not been benchmarked in this environment. Tune gpu_duration after measuring representative live calls.
Model behavior, screening, and storage
The pipeline is loaded at module scope in BF16. spaces is imported before CUDA libraries, and the GPU-bound Gradio handlers are directly decorated. Only Turbo is loaded; there is no silent substitution of another generator. VAE slicing limits decode memory spikes. Generation calls share one queue concurrency group. The model weights stay under their original license.
The Falconsai classifier screens every generated image before display or download. Classification failures withhold the image. This classifier targets NSFW imagery and is not comprehensive moderation: it does not reliably identify consent, identities, illegal acts, or every category in Krea's policy. Public operators must review their use case, monitor abuse reports, and add appropriate safeguards under the model license and policy. The app does not claim that this filter alone establishes compliance.
The app does not implement persistent user accounts or image history. Gradio temporarily caches outputs for downloads and cleans old generated cache files on an hourly schedule; cached public example outputs may persist longer. Prompts and images are not logged by application code. JSON settings shown to the current user include their prompt and actual generation parameters. Do not enter confidential data into a public demo.
Sources
- Model card and official inference example
- Official Krea demo
- Working Turbo example
- Diffusers Krea2 pipeline, v0.40.0
- Output screening model
- Hugging Face Space instructions
Independent demo; no affiliation with or endorsement by Krea is implied.
