From 4985b87eb553246f5a17b87e49ff4663c145e019 Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 14 Sep 2026 18:38:50 +0800 Subject: [PATCH] trigger keepalive if cf tunnel detected for image gen --- koboldcpp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koboldcpp.py b/koboldcpp.py index 65449eb8e..85acd5481 100644 --- a/koboldcpp.py +++ b/koboldcpp.py @@ -7987,7 +7987,8 @@ Change Mode
if override_abort_gen is not None and tryparseint(override_abort_gen, 1): #enable keepalive on poor connection mode abort_gen = None send_keepalive = True - if tryparseint(genparams.get('frames', 1), 1) > 1: #enable keepalive if more than 1 frame + # Cloudflare proxy heuristic, trigger keepalive if cloudflare is detected + if self.headers.get('CF-Connecting-IP'): send_keepalive = True if send_keepalive: # Close-delimited JSON works with HTTP/1.0 and HTTP/1.1.