Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

Site: nav Download button gets the installer for the visitor's OS

Gabriele Lozupone9795f0acee3a
diff --git a/site/download.js b/site/download.js
index 2593011..60c6560 100644
--- a/site/download.js
+++ b/site/download.js
@@ -1,6 +1,13 @@
// Point the download buttons straight at the installer of the latest GitHub release.
// If the API can't be reached (offline, rate limit), they keep linking to the release page.
+// Buttons marked data-dl-auto (the nav one) download the installer for the visitor's OS;
+// on any other OS they keep their own link (the hero buttons or the release page).
(() => {
+ const ua = navigator.userAgent;
+ const os = /Windows/.test(ua) ? "windows"
+ : /Macintosh/.test(ua) && navigator.maxTouchPoints < 2 ? "mac" // iPads also say Macintosh
+ : null;
+ if (os) document.querySelectorAll("a[data-dl-auto]").forEach((a) => (a.dataset.dl = os));
const links = document.querySelectorAll("a[data-dl]");
if (!links.length) return;
const PICK = { windows: /_x64-setup\.exe$/, mac: /_aarch64\.dmg$/ };
diff --git a/site/index.html b/site/index.html
index 017ee70..2448060 100644
--- a/site/index.html
+++ b/site/index.html
@@ -215,7 +215,7 @@
</nav>
<span class="spacer"></span>
<a class="gh" href="https://github.com/GabrieleLozupone/kokon" rel="noopener"><svg width="18" height="18" fill="currentColor"><use href="#github"/></svg>GitHub</a>
- <a class="btn primary small" href="#download">Download</a>
+ <a class="btn primary small" href="#top" data-dl-auto>Download</a>
</div>
</header>
diff --git a/site/mcp-image-generation/index.html b/site/mcp-image-generation/index.html
index 3ff2efa..c36c146 100644
--- a/site/mcp-image-generation/index.html
+++ b/site/mcp-image-generation/index.html
@@ -74,7 +74,7 @@
<a href="../#faq">FAQ</a>
</nav>
<span class="spacer"></span>
- <a class="btn primary small" href="https://github.com/GabrieleLozupone/kokon/releases/latest" rel="noopener">Download</a>
+ <a class="btn primary small" href="https://github.com/GabrieleLozupone/kokon/releases/latest" rel="noopener" data-dl-auto>Download</a>
</div>
</header>
@@ -172,5 +172,6 @@
</nav>
</div>
</footer>
+<script src="/download.js" defer></script>
</body>
</html>
diff --git a/site/qwen-image-2-1-local/index.html b/site/qwen-image-2-1-local/index.html
index a1fbbcc..4ee2e4d 100644
--- a/site/qwen-image-2-1-local/index.html
+++ b/site/qwen-image-2-1-local/index.html
@@ -75,7 +75,7 @@
<a href="../#faq">FAQ</a>
</nav>
<span class="spacer"></span>
- <a class="btn primary small" href="https://github.com/GabrieleLozupone/kokon/releases/latest" rel="noopener">Download</a>
+ <a class="btn primary small" href="https://github.com/GabrieleLozupone/kokon/releases/latest" rel="noopener" data-dl-auto>Download</a>
</div>
</header>
@@ -193,5 +193,6 @@
</nav>
</div>
</footer>
+<script src="/download.js" defer></script>
</body>
</html>