Issue
This has long been an issue, where running Forge on my PC and remotely accessing the UI through --listen and my chosen port using a mobile device.
In the past, this would sometimes get stuck when running batches of txt2img. I could start a batch from my mobile browser and then open other apps on the device, and then navigate back to my browser after the expected generation time had passed and the batch would usually be finished. Occasionally it would not load the output images, and I could remedy this by restarting the UI on the mobile device and carry on as normal. This was annoying but could be worked around with some small loss of output images on the mobile device (they were still being generated and could be found in the outputs folder on the PC where Forge runs).
Currently I can run outputs with the window focused, but if I unfocus the app, the images never load, and any future generations will run, showing the progress bar ticking up, but when the job is completed the images fail to load in the browser. When running locally on my PC these problems do not occur.
Today I have seen that all generations are failing when unfocusing the browser on the mobile device, without exception. After trying various things with my firewall and the browser app on mobile, I have removed Forge and reinstalled it using the standalone installer, then updated it. I re-edited my batch files to use --listen and --port that I used before. I've then removed all extensions in the Forge UI, then restarted the console. Then I went and tested on my usual mobile browser (Brave) and saw the problem persists. I have also tried a cleanly installed Chrome browser and see the same issues.
I did see that windows defender had blocked a file that was in the Forge folder. I have allowed this to run and both devices and have restarted the webui console, but this has made no difference.
Steps to reproduce the problem
1: Start forge webui with arguments --listen --port 9090
2: Navigate to https://[localIP]:9090 on mobile device
3: Run txt2img with browser focused, receive output images as normal
4: Run again with batch size >1, unfocus browser when generating
5: When refocusing browser, image gen completed but the output images are the same as before (with seed set to -1)
6: Running again, even staying focused the whole time, the image progress bar goes to 100% and then does not load new output images
What should have happened?
Images generate even when not actively viewing browser
What browsers do you use to access the UI ?
Google Chrome, Brave
Console logs
Launching Web UI with arguments: --listen --port 9090
Total VRAM 24564 MB, total RAM 64507 MB
pytorch version: 2.3.1+cu121
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 4090 : native
Hint: your device supports --cuda-malloc for potential speed improvements.
VAE dtype preferences: [torch.bfloat16, torch.float32] -> torch.bfloat16
CUDA Using Stream: False
D:\myDir\Forge\webui_forge_cu121_torch231\system\python\lib\site-packages\transformers\utils\hub.py:128: FutureWarning: Using `TRANSFORMERS_CACHE` is deprecated and will be removed in v5 of Transformers. Use `HF_HOME` instead.
warnings.warn(
Using pytorch cross attention
Using pytorch attention for VAE
Loading additional modules ... done.
Model selected: {'checkpoint_info': {'filename': 'D:\\myDir\\Forge\\webui_forge_cu121_torch231\\webui\\models\\Stable-diffusion\\myModel3.ckpt', 'hash': 'd51c06f0'}, 'additional_modules': ['D:\\myDir\\Forge\\webui_forge_cu121_torch231\\webui\\models\\VAE\\sdxl_vae.safetensors'], 'unet_storage_dtype': None}
Using online LoRAs in FP16: False
Running on local URL: http://0.0.0.0:9090
To create a public link, set `share=True` in `launch()`.
Startup time: 19.7s (prepare environment: 1.3s, launcher: 0.3s, import torch: 4.3s, other imports: 0.2s, initialize google blockly: 8.1s, create ui: 1.1s, gradio launch: 4.3s).
Environment vars changed: {'stream': False, 'inference_memory': 1001.0, 'pin_shared_memory': False}
[GPU Setting] You will use 95.92% GPU memory (23562.00 MB) to load weights, and use 4.08% GPU memory (1001.00 MB) to do matrix computation.
Loading Model: {'checkpoint_info': {'filename': 'D:\\myDir\\Forge\\webui_forge_cu121_torch231\\webui\\models\\Stable-diffusion\\myModel3.ckpt', 'hash': 'd51c06f0'}, 'additional_modules': ['D:\\myDir\\Forge\\webui_forge_cu121_torch231\\webui\\models\\VAE\\sdxl_vae.safetensors'], 'unet_storage_dtype': None}
[Unload] Trying to free all memory for cuda:0 with 0 models keep loaded ... Done.
StateDict Keys: {'unet': 1680, 'vae': 250, 'text_encoder': 196, 'text_encoder_2': 518, 'ignore': 0}
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
IntegratedAutoencoderKL Unexpected: ['model_ema.decay', 'model_ema.num_updates']
K-Model Created: {'storage_dtype': torch.float16, 'computation_dtype': torch.float16}
Model loaded in 2.1s (unload existing model: 0.1s, forge model load: 2.0s).
[Unload] Trying to free 3028.58 MB for cuda:0 with 0 models keep loaded ... Done.
[Memory Management] Target: JointTextEncoder, Free GPU: 22982.00 MB, Model Require: 1559.68 MB, Previously Loaded: 0.00 MB, Inference Require: 1001.00 MB, Remaining: 20421.32 MB, All loaded to GPU.
Moving model(s) has taken 0.48 seconds
[Unload] Trying to free 1001.00 MB for cuda:0 with 1 models keep loaded ... Current free memory is 21138.90 MB ... Done.
[Unload] Trying to free 1001.00 MB for cuda:0 with 1 models keep loaded ... Current free memory is 21137.64 MB ... Done.
[Unload] Trying to free 7656.40 MB for cuda:0 with 0 models keep loaded ... Current free memory is 21136.78 MB ... Done.
[Memory Management] Target: KModel, Free GPU: 21136.78 MB, Model Require: 4897.05 MB, Previously Loaded: 0.00 MB, Inference Require: 1001.00 MB, Remaining: 15238.73 MB, All loaded to GPU.
Moving model(s) has taken 0.59 seconds
100%|##################################################################################| 22/22 [00:08<00:00, 2.62it/s]
[Unload] Trying to free 4495.36 MB for cuda:0 with 0 models keep loaded ... Current free memory is 16120.95 MB ... Done.
[Memory Management] Target: IntegratedAutoencoderKL, Free GPU: 16120.95 MB, Model Require: 159.56 MB, Previously Loaded: 0.00 MB, Inference Require: 1001.00 MB, Remaining: 14960.39 MB, All loaded to GPU.
Moving model(s) has taken 0.11 seconds
[Unload] Trying to free 1001.00 MB for cuda:0 with 1 models keep loaded ... Current free memory is 15956.00 MB ... Done.
[Unload] Trying to free 1001.00 MB for cuda:0 with 1 models keep loaded ... Current free memory is 15954.12 MB ... Done.
[Unload] Trying to free 1001.00 MB for cuda:0 with 1 models keep loaded ... Current free memory is 15952.86 MB ... Done.
[Unload] Trying to free 3870.72 MB for cuda:0 with 1 models keep loaded ... Current free memory is 15951.51 MB ... Done.
100%|##################################################################################| 22/22 [00:23<00:00, 1.06s/it]
[Unload] Trying to free 4287.94 MB for cuda:0 with 1 models keep loaded ... Current free memory is 15950.03 MB ... Done.
Issue This has long been an issue, where running Forge on my PC and remotely accessing the UI through --listen and my chosen port using a mobile device.
In the past, this would sometimes get stuck when running batches of txt2img. I could start a batch from my mobile browser and then open other apps on the device, and then navigate back to my browser after the expected generation time had passed and the batch would usually be finished. Occasionally it would not load the output images, and I could remedy this by restarting the UI on the mobile device and carry on as normal. This was annoying but could be worked around with some small loss of output images on the mobile device (they were still being generated and could be found in the outputs folder on the PC where Forge runs).
Currently I can run outputs with the window focused, but if I unfocus the app, the images never load, and any future generations will run, showing the progress bar ticking up, but when the job is completed the images fail to load in the browser. When running locally on my PC these problems do not occur.
Today I have seen that all generations are failing when unfocusing the browser on the mobile device, without exception. After trying various things with my firewall and the browser app on mobile, I have removed Forge and reinstalled it using the standalone installer, then updated it. I re-edited my batch files to use --listen and --port that I used before. I've then removed all extensions in the Forge UI, then restarted the console. Then I went and tested on my usual mobile browser (Brave) and saw the problem persists. I have also tried a cleanly installed Chrome browser and see the same issues.
I did see that windows defender had blocked a file that was in the Forge folder. I have allowed this to run and both devices and have restarted the webui console, but this has made no difference.
Steps to reproduce the problem 1: Start forge webui with arguments --listen --port 9090 2: Navigate to https://[localIP]:9090 on mobile device 3: Run txt2img with browser focused, receive output images as normal 4: Run again with batch size >1, unfocus browser when generating 5: When refocusing browser, image gen completed but the output images are the same as before (with seed set to -1) 6: Running again, even staying focused the whole time, the image progress bar goes to 100% and then does not load new output images
What should have happened? Images generate even when not actively viewing browser
What browsers do you use to access the UI ? Google Chrome, Brave
Console logs