Skip to content

Commit 1a49110

Browse files
committed
[chore] make experiment asset api setting hidden (#5851)
## Summary This way no one can accidentally enable it when they are messing around. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5851-chore-make-experiment-asset-api-setting-hidden-27d6d73d36508113a6c1e41a764325f3) by [Unito](https://www.unito.io)
1 parent 620250c commit 1a49110

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/platform/assets/services/assetService.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { useModelToNodeStore } from '@/stores/modelToNodeStore'
1313
const ASSETS_ENDPOINT = '/assets'
1414
const MODELS_TAG = 'models'
1515
const MISSING_TAG = 'missing'
16+
const EXPERIMENTAL_WARNING = `EXPERIMENTAL: If you are seeing this please make sure "Comfy.Assets.UseAssetAPI" is set to "false" in your ComfyUI Settings.\n`
1617

1718
/**
1819
* Input names that are eligible for asset browser
@@ -27,7 +28,9 @@ function validateAssetResponse(data: unknown): AssetResponse {
2728
if (result.success) return result.data
2829

2930
const error = fromZodError(result.error)
30-
throw new Error(`Invalid asset response against zod schema:\n${error}`)
31+
throw new Error(
32+
`${EXPERIMENTAL_WARNING}Invalid asset response against zod schema:\n${error}`
33+
)
3134
}
3235

3336
/**
@@ -45,7 +48,7 @@ function createAssetService() {
4548
const res = await api.fetchApi(url)
4649
if (!res.ok) {
4750
throw new Error(
48-
`Unable to load ${context}: Server returned ${res.status}. Please try again.`
51+
`${EXPERIMENTAL_WARNING}Unable to load ${context}: Server returned ${res.status}. Please try again.`
4952
)
5053
}
5154
const data = await res.json()
@@ -174,7 +177,7 @@ function createAssetService() {
174177
const res = await api.fetchApi(`${ASSETS_ENDPOINT}/${id}`)
175178
if (!res.ok) {
176179
throw new Error(
177-
`Unable to load asset details for ${id}: Server returned ${res.status}. Please try again.`
180+
`${EXPERIMENTAL_WARNING}Unable to load asset details for ${id}: Server returned ${res.status}. Please try again.`
178181
)
179182
}
180183
const data = await res.json()
@@ -188,7 +191,9 @@ function createAssetService() {
188191
const error = result.error
189192
? fromZodError(result.error)
190193
: 'Unknown validation error'
191-
throw new Error(`Invalid asset response against zod schema:\n${error}`)
194+
throw new Error(
195+
`${EXPERIMENTAL_WARNING}Invalid asset response against zod schema:\n${error}`
196+
)
192197
}
193198

194199
return {

src/platform/settings/constants/coreSettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ export const CORE_SETTINGS: SettingParams[] = [
10521052
{
10531053
id: 'Comfy.Assets.UseAssetAPI',
10541054
name: 'Use Asset API for model library',
1055-
type: 'boolean',
1055+
type: 'hidden',
10561056
tooltip: 'Use new Asset API for model browsing',
10571057
defaultValue: false,
10581058
experimental: true

0 commit comments

Comments
 (0)