diff --git a/sponsors.json b/sponsors.json new file mode 100644 index 0000000..1cfd251 --- /dev/null +++ b/sponsors.json @@ -0,0 +1,80 @@ +{ + "LICENSE": { + "name": "BSD3-Clause", + "url": { + "en": "https://github.com/zombieyang/sd-ppp/blob/main/LICENSE", + "zhcn": "https://gitee.com/zombieyang/sd-ppp/blob/main/LICENSE" + } + }, + "sponsors": [ + { + "name": "四喜AI", + "url": "https://v.douyin.com/hD2X7S717uw/" + }, + { + "name": "沐沐AI", + "url": "https://v.douyin.com/k6yKDEcVgP8/" + } + ], + "links": [ + { + "name": "猫咪老师Reimagined", + "url": "https://www.xiaohongshu.com/user/profile/59f1fcc411be101aba7f048f" + }, + { + "name": "来真的", + "url": "https://space.bilibili.com/590784254" + }, + { + "name": "哑狗Egao", + "url": "https://space.bilibili.com/284721975" + } + ], + "community": { + "en": [ + { + "name": "Github", + "url": "https://github.com/zombieyang/sd-ppp" + }, + { + "name": "Discord", + "url": "https://discord.gg/9HeGjDvEmn" + }, + { + "name": "Youtube", + "url": "https://www.youtube.com/@Github-Zombeeyang/videos" + } + ], + "zhcn": [ + { + "name": "Github", + "url": "https://github.com/zombieyang/sd-ppp" + }, + { + "name": "QQ频道", + "url": "https://pd.qq.com/s/5m42umo28" + }, + { + "name": "Bilibili", + "url": "https://space.bilibili.com/44908313" + } + ] + }, + "cloud": { + "en": [], + "zhcn": [ + { + "name": "Cephalon", + "url": "https://cephalon.cloud/share/register-landing?invite_id=m95SDj", + "icon": "https://cephalon.cloud/favicon.ico", + "color": "#000000" + }, + { + "name": "晨羽智云", + "url": "https://www.chenyu.cn/console/login?invitationCode=BUD913", + "icon": "https://www.chenyu.cn/favicon.ico", + "color": "#f3ac40" + } + ] + } +} \ No newline at end of file diff --git a/typescripts/modules/comfy/src/comfy-nodes/nodes.mts b/typescripts/modules/comfy/src/comfy-nodes/nodes.mts index 213a1cf..896c938 100644 --- a/typescripts/modules/comfy/src/comfy-nodes/nodes.mts +++ b/typescripts/modules/comfy/src/comfy-nodes/nodes.mts @@ -66,37 +66,8 @@ export class GetTextFromLayerNode extends SDPPPDownloadableNode { delete nodeData.input.optional['document']; } } - private documentWidget: DocumentWidget; - private layerWidget: LayerWidget; - protected async update() { - this.documentWidget?.lockMode(this.layerConnected, i18n('document linked')) - this.layerWidget?.lockMode(this.layerConnected, i18n('layer linked')) - this.documentWidget.update(); - this.layerWidget.update(); - super.update(); - if (!this.node.widgets[0].label) - this.node.widgets[0].label = i18n(this.node.widgets[0].name) - if (!this.node.widgets[1].label) - this.node.widgets[1].label = i18n(this.node.widgets[1].name) - this.node.inputs[0].label = i18n(this.node.inputs[0].name) - this.node.outputs[0].label = i18n(this.node.outputs[0].name) - } constructor(node: any) { - const documentWidget = DocumentWidget.create(node, 'document') - const layerWidget = LayerWidget.create(node, 'layer_or_group', { - documentWidgetInNode: documentWidget, - extraOptions: [] - }); super(node); - this.documentWidget = documentWidget - this.layerWidget = layerWidget - } - protected layerConnected: boolean = false; - protected inputConnectionChange(index: number, connected: boolean) { - super.inputConnectionChange(index, connected); - if (index == 0) { - this.layerConnected = connected; - } } } diff --git a/typescripts/modules/comfy/src/popup/tsx/widgets/number.tsx b/typescripts/modules/comfy/src/popup/tsx/widgets/number.tsx index 784170a..668ac67 100644 --- a/typescripts/modules/comfy/src/popup/tsx/widgets/number.tsx +++ b/typescripts/modules/comfy/src/popup/tsx/widgets/number.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useCallback, useState, useEffect } from 'react'; import { Flex, InputNumber, Slider, Space, Typography } from 'antd'; import { useUIWeightCSS } from './hooks.mts'; import { BaseWidgetProps } from './_base'; @@ -22,16 +22,26 @@ export const NumberWidget: React.FC = ({ onValueChange }) => { const uiWeightCSS = useUIWeightCSS(uiWeight || 12); - const handleValueChange = (newValue: number | null) => { + const [localValue, setLocalValue] = useState(+value.toFixed(3)); + + // Update local state when props value changes + useEffect(() => { + setLocalValue(+value.toFixed(3)); + }, [value]); + + const handleValueChange = useCallback((newValue: number | null) => { if (newValue !== null) { // 保留3位小数 - const value = +newValue.toFixed(3); - onValueChange(value); + const roundedValue = +newValue.toFixed(3); + setLocalValue(roundedValue); } - }; - - const currentValue = +value.toFixed(3); + }, []); + const handleBlur = useCallback(() => { + // Only call onValueChange when input loses focus + onValueChange(localValue); + }, [localValue, onValueChange]); + // 检查步长范围是否过大 // const isStepRangeTooBig = ((inputMax - inputMin) / inputStep) > 1000; @@ -70,8 +80,9 @@ export const NumberWidget: React.FC = ({ min={inputMin} max={inputMax} step={inputStep} - value={currentValue} + value={localValue} onChange={handleValueChange} + onBlur={handleBlur} controls={false} /> diff --git a/typescripts/modules/photoshop-internal b/typescripts/modules/photoshop-internal index ace712e..24156c5 160000 --- a/typescripts/modules/photoshop-internal +++ b/typescripts/modules/photoshop-internal @@ -1 +1 @@ -Subproject commit ace712eb985a34d37cc846630e2308303c7d1acc +Subproject commit 24156c5676ec4b457b1ee4347f88660ccc4a78c3 diff --git a/typescripts/src/common/zh-cn.mts b/typescripts/src/common/zh-cn.mts index 87a9c8d..b99e151 100644 --- a/typescripts/src/common/zh-cn.mts +++ b/typescripts/src/common/zh-cn.mts @@ -202,14 +202,12 @@ export default { // about 'This plugin is based on sd-ppp': '本插件基于sd-ppp开发', 'And follows its open source license:': '并遵循其开源协议:', - "https://www.youtube.com/@Github-Zombeeyang/videos": 'https://space.bilibili.com/44908313', - "Youtube": 'BiliBili', - "https://discord.gg/9HeGjDvEmn": "https://pd.qq.com/s/5m42umo28", - "Discord": 'QQ频道', + "Cloud": "云端", "Sponsors": "赞助", "waiting...": '虚位以待', 'Links': '友情链接', 'Community': '社区', + 'LICENSE:': '许可证:', // comfy popup "upload": "上传",