660 Commits

Author SHA1 Message Date
Physton
596a931725 Merge pull request #369 from neon-aiart/fix/token-counter-v4
Fix: Use try-except to stabilize token counter during model access
2025-11-26 20:12:09 +08:00
ねおん
88be6531e8 Fix: Use try-except to stabilize token counter during model access
This fixes a server crash (TypeError NoneType in torch/nn/modules/module.py) when the token counter API is triggered during model load/switch.

Standard sequential null checks failed because the crash occurred inside PyTorch's internal attribute lookup process. The whole function is wrapped in try-except as a robust defense against this race condition.
2025-11-26 16:22:35 +09:00
ねおん
077daf3f6e FIX: Prevent critical TypeError in token counter with robust null check (v4)
The token counter was crashing during model loading/unloading (race condition) because it was attempting to access attributes on an object that was momentarily None.

This fix introduces a sequential and robust null check (sd_models.model_data is None or sd_models.model_data.sd_model is None) at the start of the function to safely return 0 tokens during unstable states.
2025-11-26 02:07:14 +09:00
Physton
1b2cce5433 Merge pull request #368 from neon-aiart/fix/token-counter-nonetype
FIX: Token Counter TypeError (v2: Handle cond_stage_model is None)
2025-11-15 22:58:33 +08:00
ねおん
b49e275eb0 FIX: Prevent TypeError in token counter during model switching (v2)
The previous fix (v1) was incomplete, as sd_model.cond_stage_model could still be None during model loading/unloading sequences (observed with XYZ Plot model swapping).
This v2 fix adds a specific check for cond_stage_model to ensure stability in dynamic environments.
2025-11-15 23:52:24 +09:00
Physton
6a4fb7015b Merge pull request #366 from neon-aiart/main
Fix: Prevent TypeError: 'NoneType' is not iterable on model switching
2025-11-10 09:44:38 +08:00
ねおん
fea3070a40 FIX: Prevent TypeError: NoneType on model switching in token counter
This fixes the critical `TypeError: argument of type 'NoneType' is not iterable` that frequently occurs in the token counter when the main Stable Diffusion model is being unloaded or reloaded (e.g., during XYZ Plot or manual model switching).

The error happens because the `get_token_counter` function tries to access `sd_models.model_data.sd_model.cond_stage_model` when `sd_model` is momentarily `None`.

The fix adds a robust check for `sd_models.model_data.sd_model is None` at the start of the function, ensuring the token counter safely returns 0 instead of causing an ASGI application crash across all environments (A1111, Forge/reForge).
2025-11-10 02:49:34 +09:00
ねおん
0aa3c04de4 Update get_token_counter.py 2025-11-10 02:44:22 +09:00
ねおん
8bf3dbad47 FIX: Safely handle None model data during model switching to prevent TypeError in token counter 2025-11-10 02:29:18 +09:00
ねおん
d7865901ec Update get_token_counter.py 2025-11-10 02:28:05 +09:00
ねおん
9e1ced6438 Fix: Prevent TypeError: 'NoneType' is not iterable on model switching (Forge/reForge)
This fixes the TypeError that occurs during model switching in sd-webui-reforge and possibly other optimized environments.

The error happens because 'get_token_counter' tries to access 'sd_models.model_data.sd_model.cond_stage_model' before the model is fully loaded (when 'sd_model' is None).

The fix adds a check for the 'None' value to safely return 0 tokens instead of throwing an error.
2025-11-04 03:14:14 +09:00
Physton
b00149b4c7 Merge pull request #362 from KevinX25/patch-1
Create Leticia service
2025-05-12 09:40:10 +08:00
KevinX25
376deb20b1 Create Leticia service
from together import Together

image = client.images.generate(
    prompt="MJ v6, A sensual, full-body anime elf girl with long, flowing silver hair and sparkling highlights, deep red eyes, and a seductive, lustful expression, posing with both hands grasping a green wine bottle, wearing an Egyptian-inspired sheer black skirt with intricate golden embroidery, split front and back panels, and a delicate black silk veil draped over her head, paired with black elbow-length fingerless gloves, elegant golden jewelry, and ornate bracelets, set against a dark fantasy blur background with soft body lighting, detailed anime shading, and line art, strong contrast with dramatic shadows, cinematic lighting, and a Goblin Slayer-inspired aesthetic, rendered in a highly detailed, ultra-sharp, and masterful style, with a focus on photorealistic textures and a close-up composition that emphasizes the subject's intricate features and sensual presence.",
    model="black-forest-labs/FLUX.1-dev-lora",
    height=768,
    width=1024,
    seed=8910047,
    steps=28,
    image_loras=[
        {
            "path": "https://huggingface.co/strangerzonehf/Flux-Midjourney-Mix2-LoRA",
            "scale": 1,
        },
    ],
)

print(image.data[0].url)
2025-05-11 17:38:07 -05:00
Physton
ff8511b5dd Merge pull request #360 from ubansi/fix_japanease_tag_name 2025-04-20 00:06:58 +08:00
ubansi
985477854b Fix: Translated some Chinese text to Japanese 2025-04-19 02:57:03 +09:00
physton
21654832ef Merge branch 'main' of https://github.com/Physton/sd-webui-prompt-all-in-one 2024-12-14 20:30:33 +08:00
physton
d84a3353ed Update README.MD 2024-12-14 20:30:19 +08:00
Physton
c63b8a043f Merge pull request #355 from PTCMode/main
[fix] 解决一个可能导致启动失败的问题 & 解决firefox下提示词框体显示问题的样式方案
2024-12-14 20:18:45 +08:00
PTCMode
2938717315 [fix] 修复一个由于遗留锁导致UI加载可能会失败的问题 2024-12-14 01:54:16 +08:00
PTCMode
31fef02d6b [fix] 添加一个临时解决firefox下提示词显示问题的样式方案 2024-12-14 01:51:09 +08:00
physton
d69645e6a6 build 2024-06-10 14:32:44 +08:00
Physton
7bd3a0940a Merge pull request #337 from bluelovers/pr/getFavorites-001
refactor: try avoid request api at same time
2024-06-10 14:31:53 +08:00
bluelovers
bad38d5050 . 2024-06-09 08:06:20 +08:00
bluelovers
f304c5eb84 refactor: try avoid request api at same time 2024-06-06 17:43:11 +08:00
bluelovers
9a2a366e65 chore: try getFavorites one by one
https://github.com/Physton/sd-webui-prompt-all-in-one/issues/328
2024-06-06 09:47:52 +08:00
physton
d806005dad build 2024-06-04 23:43:10 +08:00
Physton
b5021f402c Merge pull request #336 from bluelovers/patch-4
chore: use async avoid block other onUiLoaded cb
2024-06-04 23:41:45 +08:00
bluelovers
b4e04c853f chore: use async avoid block other onUiLoaded cb 2024-06-04 17:53:49 +08:00
physton
f00a3f56ba Update README.MD 2024-05-22 00:57:50 +08:00
physton
eb924ba5a1 #325 [Bug] "Facing away" is repeated 2024-04-10 12:34:00 +08:00
physton
2cd8bf2c6c Update Translators => 5.9.0 2024-03-28 23:38:57 +08:00
physton
6f7438cc85 Optimize the pop-up window interaction 2024-03-28 23:15:56 +08:00
physton
82b358dfd8 [Bug] Fix some bugs in the keyword blacklist 2024-03-27 18:13:11 +08:00
physton
993bca48cc Update README_CN.MD 2024-03-27 18:00:56 +08:00
physton
a52c5dfbda #312 [Bug] Fix the issue where the pop-up window cannot be fully displayed on low-resolution screens
修复弹窗无法再低分辨率屏幕下完整展示
2024-03-27 17:47:19 +08:00
physton
e1869b207a #317 [Bug] lost separators in prompt 2024-03-26 17:00:14 +08:00
physton
3ebc82c1cb #306 #316 [Feature] Allow customization of ChatGPT model 2024-03-24 15:33:11 +08:00
physton
2a32817694 Update build.yml 2024-03-22 17:22:33 +08:00
physton
47556e3f9c Update build.yml 2024-03-22 17:21:57 +08:00
physton
805dc41561 build 2024-03-22 17:21:27 +08:00
GitHub Actions
9a888b415d Build 2024-03-22 09:19:09 +00:00
physton
5fb24f4c69 Update groupTagsMixin.js 2024-03-22 17:18:37 +08:00
Physton
90bc20f3c3 Merge pull request #309 from thiagojramos/main
Update i18n.json
2024-03-13 11:41:58 +08:00
Thiago Ramos
b6731ab13f Update i18n.json
pt-br add
2024-03-12 20:34:14 -03:00
GitHub Actions
62178a299f Build 2024-03-10 15:35:07 +00:00
Physton
8a829426d6 Merge pull request #308 from yangming915/main
let it work better with extranetwork-lora
2024-03-10 23:34:40 +08:00
yangming
90d05207ec let it work better with extranetwork-lora 2024-03-10 03:16:37 +08:00
GitHub Actions
d0eb9c5b7d Build 2024-02-16 09:56:20 +00:00
physton
031fd28372 #303 [Bug] Extra Networks not loading Checkpoints in subfolders 2024-02-16 17:55:53 +08:00
GitHub Actions
827f2ab54d Build 2024-02-16 09:14:55 +00:00