Files
ComfyUI_frontend/index.html
Christian Byrne 194fbdf520 remove user.css on cloud to prevent failed requests on startup (#7442)
## Summary

Removes the user.css put at top of the index.html when building for
cloud.

On local, now compiles to this (pictured):
<img width="1909" height="184" alt="image"
src="https://github.com/user-attachments/assets/be03beea-35e9-47d6-a293-08f2971b04be"
/>

Formatted, that looks like:

```html
<!doctype html>
<html lang="en">
   <head>
      <link rel="stylesheet" href="user.css">
      <link rel="stylesheet" href="api/userdata/user.css">
      <meta charset="UTF-8">
      <title>ComfyUI</title>
      <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
      <link rel="stylesheet" href="materialdesignicons.min.css"/>
      <meta name="mobile-web-app-capable" content="yes">
      <meta name="apple-mobile-web-app-status-bar-style" content="black">
      <link rel="manifest" href="./assets/manifest-CebUEmtR.json">
      <script type="module" crossorigin src="./assets/index-DuwpHar_.js"></script>
      <link rel="modulepreload" crossorigin href="./assets/vendor-other--dOoND1c.js">
      <link rel="modulepreload" crossorigin href="./assets/vendor-primevue-BPXiTI_h.js">
      <link rel="modulepreload" crossorigin href="./assets/vendor-vue-RrbnUvXR.js">
      <link rel="modulepreload" crossorigin href="./assets/vendor-xterm-BZLod3g9.js">
      <link rel="modulepreload" crossorigin href="./assets/vendor-three-aR6ntw5X.js">
      <link rel="modulepreload" crossorigin href="./assets/vendor-tiptap-BVGjFCxT.js">
      <link rel="stylesheet" crossorigin href="./assets/vendor-other-DODGPXtn.css">
      <link rel="stylesheet" crossorigin href="./assets/vendor-xterm-BKlWQB97.css">
      <link rel="stylesheet" crossorigin href="./assets/index-CX9dQXxD.css">
   </head>
   <body class="litegraph grid">
      <div id="vue-app"></div>
   </body>
</html>
```

On cloud, this:

<img width="1911" height="1106" alt="image"
src="https://github.com/user-attachments/assets/bbf6046b-e2fd-4e02-bb71-cba27f579271"
/>


## Context

On the cloud distribution, there are currently 401 errors appearing in
the console from requests attempting to load custom user stylesheets:

- `https://cloud.comfy.org/user.css` (returns 200)
- `https://cloud.comfy.org/api/userdata/user.css` (returns 401)

This is a feature inherited from local ComfyUI that allows users to add
custom stylesheets. The implementation naively requests the stylesheet
from the server, and if the user has added one, it gets loaded;
otherwise, the request fails.

This PR removes the custom stylesheet loading from the cloud
distribution by removing it from teh index.html and only re-injecting it
on non-cloud builds.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7442-remove-user-css-on-cloud-to-prevent-failed-requests-on-startup-2c86d73d3650813d82a0deb3b01cee74)
by [Unito](https://www.unito.io)
2025-12-13 18:38:04 -07:00

22 lines
705 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ComfyUI</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="stylesheet" type="text/css" href="materialdesignicons.min.css" />
<!-- Fullscreen mode on mobile browsers -->
<meta name="mobile-web-app-capable" content="yes">
<!-- Status bar style (eg. black or transparent) -->
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="manifest" href="manifest.json">
</head>
<body class="litegraph grid">
<div id="vue-app"></div>
<script type="module" src="src/main.ts"></script>
</body>
</html>