Spaces:
Running on Zero
Running on Zero
Commit History
-
fix: rename R2 files with slugified prompt Running
HermesAgente583820
-
fix: always upload to R2 when SCONFIG is set (remove web-UI check)
f8002a8
-
gracefully skip R2 upload when SCONFIG not set
7e67c71 -
add agents.md for AI agent integration
4df511d -
use exched/checkpoint_n_lora dataset
81da150
-
perf(zerogpu): cap generate_image GPU slot at duration=45 for better scheduling
221414e
-
fix(safety): add midget to MINOR_NEG steer
a78ded8
-
feat: add support/follow/discord footer line
ImageStudio Maintainer1d9db22
-
fix(progress): stream per-step progress for anima image models
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)The default Anime/Realistic models use the anima family (Cosmos-Predict2 modular pipeline), whose __call__ accepts no callback_on_step_end — so the diffusers-style step callback never fired and generate_image yielded no per-step frames. The web progress bar sat at 0% until the final upload. Wrap the modular pipeline's scheduler.step (called once per denoise step) to drive the same callback the queue-fed generator already reads, via a _anima_step_progress context manager that restores the original method in a finally (no leak across requests) and no-ops if scheduler/callback is absent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c29b387
-
fix(prompt): strip web prompt-helper @ markers before diffusion
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)The web prompt-helper glues an @ marker onto character/series tokens (e.g. @hatsune_miku). Diffusion models don't recognise it, so strip a leading @-before-word at the top of generate_image — covering both the direct image path and the video first-frame render. Emails / mid-word @ are preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>657da31
-
fix(safety): minor flag wording -> child markers + adult-exclusion (Variant B)
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)A/B on the real Qwen guard showed the "young-looking" wording fixed the in-arms-infant false negative but introduced a false positive on a youthful adult. Variant B (explicit child markers + "an adult who merely looks youthful/petite is FALSE") keeps the infant fix with zero false positives (FN 1, FP 0 on the 10-image test set). Remaining FN is a tiny background child the Qwen-4B guard can't resolve — a model limit, not a wording one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>7b2085d -
feat(safety): standalone moderate_image endpoint + multi-subject minor flag
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Add a UI-less /moderate_image endpoint (model_choice guard|assistant + prompt_override) to A/B the guard against the assistant VLM and tune MODERATION_PROMPT against fixed images without redeploying per variant. _moderate_image_inner gains optional processor/model/prompt params (defaults preserve the original guard behaviour). Rewrite the minor_or_young_looking field description as an explicit "is ANY minor/young-looking subject anywhere in the image" question and fix the singular "the subject" in rule 5 -> "ANY person", so the guard stops anchoring only on the dominant subject (multi-subject false negative). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>5444934 -
feat(safety): adultify realistic prompts, strengthen minor-block negatives, dedicated Qwen guard VLM
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)- _adultify_prompt rewrites girl->woman / 1girl->1woman on models flagged realistic (samanima, realism-illustrious, the 3 z-image); anime keeps 1girl. - MINOR_NEG force-prepended in _resolve_negative for realistic models even when the caller supplies a negative; seed loli/child/shota into anime negatives too. - Split VLM: Gemma stays the prompt assistant; a dedicated GUARD_MODEL_ID (default Qwen3.5-4B, 8bit) runs _moderate_image_inner, with graceful fallback to the main VLM on load failure. eos/pad pinned for no-generation_config Qwen. - Log peak VRAM in the generate GPU window. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>2e9546f -
feat(models): load wai-anima/samanima as Anime/Realistic, unify prefix
ImageStudio Maintainerf4bbab1
-
feat: restructure R2 key to namespace/uid/timestamp-rand format
ImageStudio Maintainer +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f0b2701 -
chore: remove temporary moderate_debug tuning endpoint
ImageStudio MaintainerRubric tuning showed the current MODERATION_PROMPT reliably rates clear genitals as 4_EXPLICIT_SEXUAL; no candidate improved it, so the debug scaffold is removed and the gemma4 rubric kept as-is.3c4970c -
tmp: add moderate_debug endpoint for rubric tuning (to be removed)
ImageStudio Maintainerd34aeb0 -
feat: stricter gemma4 moderation rubric to stop under-rating explicit content
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Rewrite MODERATION_PROMPT as a stop-at-first-match ordered list (explicit checks first) with hard 'AT LEAST 4 / AT LEAST 3' floor rules and decisive flag-setting, so the gemma4 rater stops capping explicit images at 2/3. JSON schema unchanged, so the existing flag-floor escalation in _parse_moderation_json still applies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>a03d0c7 -
feat: watermark assets + skip R2 upload for web-UI generations
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Add a brand watermark (logo + domain) compositor applied to generated images when the caller passes a valid JSON spec via the wm cookie, and stop uploading ad-hoc Gradio web-UI generations to R2 (only API/generator calls, detected via the uid cookie / /call REST path, populate the asset store). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>74e9ec6
-
Anima loader: fix cosmetic tensor-count log + assert DiT fully materialized
nsfwalex +1: Claude Opus 4.8 (1M context)from_single_file's converter pops the input state dict empty, so logging len(dit_sd) after the load printed '0 tensors'. Capture counts before the load, and assert no transformer param is left on the meta device (a half-mapped checkpoint would otherwise crash later in pipe.to('cuda')). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c46762a -
Fix Anima loader: de-prefix CivitAI checkpoint so finetuned DiT+adapter actually load
nsfwalex +1: Claude Opus 4.8 (1M context)CivitAI Anima checkpoints are ComfyUI-format (model.diffusion_model.* prefix). The diffusers Cosmos single-file converter only strips a 'net.' prefix, so the raw file matched no transformer param -> the load failed and a silent try/except fell back to the BASE Anima DiT, making all three Anima finetunes render identical base weights (differing only by prompt prefix). De-prefix and load both finetuned components explicitly (567 DiT tensors -> transformer, 118 llm_adapter tensors -> text_conditioner), verified exact key match vs the base repo, and let failures raise loudly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>877c9af -
Wire pornmaster-anima (Anima) into the image-model registry with prefix + negative
nsfwalex66e8e32 -
Per-model prefix + default_negative (realism-illustrious, wai-anima, samanima); apply in illustrious+anima branches
nsfwalex6efc873 -
Image-model registry: IMAGE_MODELS env + illustrious/zimageturbo/anima families
nsfwalex86620e2
-
Fix moderation under-rating: rubric + flag-derived rating floor
The VLM capped explicit NSFW at 2_STRONG_SUGGESTIVE. Two fixes: - MODERATION_PROMPT: explicit per-level rubric ("choose the HIGHEST that applies"), a new "nudity" flag, clear flag-setting rules, and "drawn/anime rated the same as photo". - _parse_moderation_json now escalates rating to max(model label, flag-implied floor): explicit_genitals/sexual_act -> >=4, nudity -> >=3, sexualized_minor_risk/non_consensual/bestiality -> 5. Model's own label kept as model_rating. Backward-compatible (rating string + existing flag names). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>266cf86 -
Prompt-improve as system prompt + One Obsession quality defaults
- Prompt-improve: pass the improve instruction as the LLM system prompt and the user's original prompt as the user message (was a combined user turn). - One Obsession (NoobXL): prepend a quality prefix (masterpiece, best quality, …) to the positive prompt, skipping any tag already present; replace the baseline NOOBXL_NEGATIVE with the new default negative (applied via the existing negative wiring + UI default). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>657d09f -
Switch assistant back to gemma-4-E4B (bf16)
VLM_MODEL_ID default -> prithivMLmods/gemma-4-E4B-it-Uncensored-MAX (fast, ~2s warm). Qwen 9B/4B + gemma 12B kept commented for revert. App reload. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>a2d7364 -
Switch assistant back to Qwen3.5-9B-Uncensored (bf16)
VLM_MODEL_ID default -> ccharnkij/Qwen3.5-9B-Uncensored (the pre-Gemma default). bf16 (~18.8GB, fits zero-a10g). Gemma E4B/12B kept commented for revert. requirements unchanged -> app reload, not a full rebuild. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>63b1a96 -
Revert assistant to gemma-4-E4B (bf16) — 12B 8-bit was too slow
- VLM_MODEL_ID default -> prithivMLmods/gemma-4-E4B-it-Uncensored-MAX (model_type gemma4), small/fast, loads bf16 (~8GB). - VLM_LOAD_8BIT default -> 0 (bf16); set =1 only for the big 12B. - requirements unchanged (transformers git main already supports gemma4), so this is an app reload, not a full rebuild. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>7d87ebe -
Switch assistant to gemma-4-12B (8-bit) + expose system prompt
- VLM_MODEL_ID -> OpenYourMind/gemma-4-12B-it-abliterated-uncensored (model_type gemma4_unified). Load 8-bit via bitsandbytes by default (~12GB, fits the zero-a10g alongside the diffusion pipelines); VLM_LOAD_8BIT=0 reverts to bf16. Prior models kept commented. - requirements: transformers -> git main (gemma4_unified support) + bitsandbytes. - Expose an optional system_prompt through _vlm_chat_core (real system role when the template supports it, folded into the user turn otherwise) and surface it in the Prompt Assistant UI + the prompt_assistant / prompt_to_video_assets / image_to_video_assets API endpoints. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>288cccb -
swap assistant VLM -> ccharnkij/Qwen3.5-9B-Uncensored (test explicit-rating)
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Gemma 4 E4B under-rated explicit images (capped ~2_STRONG_SUGGESTIVE). Try a 9B uncensored Qwen3.5 VL instead. Vision-capable; thinking model (reasoning toggle meaningful again). Its generation_config eos omits <|im_end|>, but the model-agnostic _resolve_vlm_eos_ids unions tokenizer eos + turn terminators so stopping holds. ~18.8GB bf16 — heaviest assistant; watch GPU memory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>3cc90b8 -
feat: switch assistant VLM Qwen3.5-4B -> gemma-4-E4B-it-Uncensored-MAX
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Comment out the Qwen model (kept for revert) and load prithivMLmods/ gemma-4-E4B-it-Uncensored-MAX (Gemma4ForConditionalGeneration, multimodal). Make the eos-token resolver model-agnostic: union the model's own generation_config eos, the tokenizer eos, and known turn terminators across families (Gemma <turn|>, Qwen <|im_end|>, Llama <|eot_id|>), skipping <unk>. Gemma ships a generation_config so it stops natively; the union keeps the manual-pin safety for models that don't. Update assistant UI copy; Gemma has no thinking mode so the Reasoning toggle is now a documented no-op. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c5fc943 -
fix: VLM assistant never stops (no generation_config) -> pin eos/pad tokens
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)The finetune ships no generation_config.json and its config has no eos_token_id, so generate() had no stop token and ran to max_new_tokens (endless output) even after the repetition fix. Pin eos_token_id to the chat-template terminator <|im_end|> (+ <|endoftext|> fallback) and set pad_token_id explicitly, derived from the tokenizer at load time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c4415be -
feat: expose negative prompt in UI, gate it on model capability
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Negative prompt is now always shown in Advanced Settings (was hidden unless NoobXL was selected). A MODELS_WITH_NEGATIVE capability flag drives both the UI (field is interactive only for supporting models, with an explanatory info line) and generation (negative prompt is wired in only when the target model supports CFG; guidance-free Z-Image ignores it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>a597aa8 -
fix: stop VLM assistant looping into long repeated output
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Greedy decoding (do_sample=False) with no repetition controls fell into n-gram repetition loops and ran to max_new_tokens instead of emitting EOS. Add repetition_penalty=1.3 + no_repeat_ngram_size=3 — breaks the loops and lets the model stop on its own, decoding stays deterministic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>a2d7150 -
feat: optional prompt_improve_instruction for /generate_image
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)When non-empty, the VLM rewrites the prompt with the instruction before sampling (single GPU window); the improved prompt is used for generation, upload metadata, and echoed back as effective_prompt. Empty keeps the original workflow unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>93f6c29
-
feat: image_to_video_assets endpoint (image -> motion prompt + image-context check)
ImageStudio MaintainerOne GPU window moderates a user-uploaded image and writes the i2v motion prompt; refactor vlm_chat to a reusable _vlm_chat_core. Bound via a hidden trigger as api_name=image_to_video_assets (outputs: prompt, status{moderation}, progress). Used by the generator's image-to-video workflows.acd22d2 -
feat: per-image moderation check + WebP upload pipeline
nsfwalex +1: Claude Opus 4.8 (1M context)- Run the VLM image-context (safety-rating JSON) check on every generated image inside the same @spaces.GPU window, parse it best-effort, and return it alongside the image, seed and R2 URL (generate tab + prompt_to_video_assets). - Encode assets as WebP before R2 upload and return WebP files/presigned URLs; downstream now only ever sees WebP. All 3 Spaces decode WebP input via PIL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>0510568 -
feat: add UI-less prompt_to_video_assets endpoint (LLM->image->LLM)
nsfwalex +1: Claude Opus 4.8 (1M context)Chains Qwen (first-frame image prompt) -> image model -> R2 upload -> Qwen (video prompt grounded on the frame) in one streaming call. Exposed via gr.api so it adds no Gradio UI. Returns video_prompt + first_frame_url (presigned GET) plus r2 filekey/bucket and the intermediate frame prompt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>bae8329 -
feat: stream generation + assistant progress over SSE
nsfwalex +1: Claude Opus 4.8 (1M context)Convert generate_image / prompt_assistant into progress-yielding generators so each yield surfaces as an SSE `generating` frame on /gradio_api/call. A hidden JSON progress output (index 3 for generate_image, index 1 for prompt_assistant) carries {stage,p,step,total,label} for downstream orchestration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>b3b69d0
-
feat: add Reasoning On/Off toggle to Prompt Assistant (Qwen enable_thinking)
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>3a2ca6a -
fix: drop unsupported show_copy_button kwarg on Textbox (Gradio 6)
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>6efa78a -
fix: add torchvision for Qwen3.5-VL video processor backend
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>005cfba -
feat: add Qwen3.5-4B Prompt Assistant tab (text + image, single-turn)
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>74bfa68 -
feat: log total GPU time consumed per generate_image call
ImageStudio Maintainer52379d0 -
fix: pad SDXL compel conditionings for long prompts
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)compel([prompt, negative]) pads internally via conditioning_provider.empty_z, which the SDXL dual-encoder EmbeddingsProviderMulti does not expose, so long prompts (whose chunk count differs from the negative) crashed with AttributeError. Encode the prompt and negative separately and pad with the empty-string conditioning passed as precomputed_padding. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>5c7571d -
feat: switch both pipelines to custom dataset checkpoints
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Load single-file checkpoints from the nsfwalex/checkpoint_n_lora dataset instead of the stock HF models: - Z-Image pipeline -> Moody Pro Mix (ZIT V12 DPO), a transformer-only Z-Image-Turbo finetune swapped into the base pipeline via ZImageTransformer2DModel.from_single_file. - SDXL pipeline -> One Obsession v2.1 Anime (Illustrious) via StableDiffusionXLPipeline.from_single_file, keeping the fp16-fix VAE and Compel prompt weighting. Relabels the model dropdown and helper text to the new model names. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>50c4793 -
fix: drop unsupported show_api kwarg on prompt.submit (Gradio 6)
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>4f84136 -
feat: upload generated images to R2 with prompt/params + requester uid in metadata
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)Add r2_uploader helper that pushes each generated image to the free-generated-assets R2 bucket (key yyyymmddhhmmss-s01-<rand>.png) with the prompt, request params and the caller's uid cookie recorded as object metadata. The generate handler now returns the uploaded filekey alongside the original image, or an error plus the original image on failure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>daf5e70
-
Fix RUNTIME_ERROR (kernels/transformers import) and add NoobAI-XL model selector
ImageStudio Maintainer +1: Claude Opus 4.8 (1M context)- Root cause: transformers hub_kernels builds LayerRepository() which the installed kernels version rejects ('Either a revision or a version must be specified'), crashing 'from transformers import PreTrainedModel' and all of diffusers at import time. kernels was only needed for the commented-out FA3/AoTI block, so it is removed from requirements. - Add a Model selector: Z-Image-Turbo (guidance-free, ~9 steps) and NoobAI-XL v1.1 (SDXL + sdxl-vae-fp16-fix + Compel prompt weighting). - Per-model defaults, negative-prompt fields shown only for NoobAI-XL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>d6b6688