Skip to content

Commit 483896a

Browse files
committed
composable diffusion is gone for good
as it is very different and can be easily misused. handle them manually instead.
1 parent b347008 commit 483896a

File tree

5 files changed

+24
-167
lines changed

5 files changed

+24
-167
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ https://tags.novelai.dev
1414
- 标签分类、释义与配图
1515
- 即时搜索
1616
- 构建标签组合并调配权重
17-
- 支持调配高级标签工程([Prompt Editing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompt-editing) / [Composable-Diffusion](https://github.com/AUTOMATIC1111/stable-diffusion-webui/#:~:text=Composable%2DDiffusion%2C%20a,a%20penguin%20%3A2.2) / [Alternating Words](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#alternating-words)
17+
- 支持调配高级标签工程([Prompt Editing](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#prompt-editing) / [Alternating Words](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#alternating-words)
1818
- 导入已有标签组合并自动匹配
1919
- 预设(固定标签组合)整理、说明与配图
2020
- 嵌入模型索引与下载

src/components/CartItem.vue

+6-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {ElButton, ElTooltip} from 'element-plus'
2222
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
2323
import {faCircleMinus, faCirclePlus, faThumbsDown, faThumbsUp, faTrash, faBlender, faRepeat, faScaleUnbalanced, faScaleUnbalancedFlip} from '@fortawesome/pro-regular-svg-icons'
2424
import LiteralWeightIdentifier from './LiteralWeightIdentifier.vue'
25-
import {type CartChildItem, type CartItem, type CartItemSimple, useCartStore, CartItemCompositionChild} from '../stores/cart'
25+
import {type CartChildItem, type CartItem, type CartItemSimple, useCartStore} from '../stores/cart'
2626
import {useSettingsStore} from '../stores/settings'
2727
import type Node from 'element-plus/es/components/tree/src/model/node'
2828
import {toRefs, inject, computed} from 'vue'
@@ -68,7 +68,7 @@ function deleteFrom(direction: 'positive' | 'negative', item: CartItem|CartChild
6868

6969
function adjustLiteralWeight(delta: number) {
7070
if (data.value.type !== 'null') {
71-
if (settingsStore.useFixedMultiplier || data.value.parent?.type === 'composition') {
71+
if (settingsStore.useFixedMultiplier) {
7272
data.value.weight = data.value.weight.add(0.05 * delta)
7373
} else {
7474
data.value.weight = data.value.weight.times(Math.pow(settingsStore.newEmphasis ? 1.1 : 1.05, delta))
@@ -125,10 +125,9 @@ const editingChildWeight = computed<Decimal>({
125125
<div class="flex">
126126
<div class="tag-label">
127127
<span class="tag-label-text" @dblclick.stop="performSearch">{{ node.label }}</span>
128-
<LiteralWeightIdentifier v-if="data.type !== 'null' && data.parent?.type !== 'composition'" v-model:weight="data.weight"
128+
<LiteralWeightIdentifier v-if="data.type !== 'null'" v-model:weight="data.weight"
129129
class="weight-identifier" />
130130
<PercentageWeightIdentifier v-if="data.parent?.type === 'editing'" v-model:weight="editingChildWeight" class="weight-identifier" />
131-
<PercentageWeightIdentifier v-if="data.parent?.type === 'composition'" v-model:weight="(data as CartItemCompositionChild).weight" class="weight-identifier" />
132131
</div>
133132
<div class="tag-button">
134133
<ElTooltip v-if="['tag', 'embedding'].includes(data.type)"
@@ -140,11 +139,10 @@ const editingChildWeight = computed<Decimal>({
140139
</ElButton>
141140
</ElTooltip>
142141

143-
<ElTooltip v-if="(data.type === 'editing' || data.type === 'alternate' || data.type === 'composition' || data.type === 'group')
144-
&& data.parent?.type !== 'composition' && cartStore.isMixtureSwitchable(data)" content="切换混合方式" :show-after="750">
142+
<ElTooltip v-if="(data.type === 'editing' || data.type === 'alternate' || data.type === 'group')
143+
&& cartStore.isMixtureSwitchable(data)" content="切换混合方式" :show-after="750">
145144
<ElButton link type="primary"
146-
@click.stop="(data.type === 'editing' || data.type === 'alternate' || data.type === 'composition' || data.type === 'group')
147-
&& data.parent?.type !== 'composition'
145+
@click.stop="(data.type === 'editing' || data.type === 'alternate' || data.type === 'group')
148146
&& cartStore.switchMixtureType(direction, data)">
149147
<FontAwesomeIcon :icon="faRepeat" />
150148
</ElButton>

src/components/CartTree.vue

+4-23
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import {ElTree} from 'element-plus'
2222
import type Node from 'element-plus/es/components/tree/src/model/node'
2323
import type {AllowDropType, NodeDropType} from 'element-plus/es/components/tree/src/tree.type'
24-
import {type CartItemEditingChild, type CartItemPresetChild, type CartItemSimple, type CartItemComplex, type CartItemComposition, type CartItemEditing, type CartItem, type CartChildItem, useCartStore, CartItemAlternate, CartItemCompositionChild} from '../stores/cart'
24+
import {type CartItemEditingChild, type CartItemPresetChild, type CartItemSimple, type CartItemComplex, type CartItemEditing, type CartItem, type CartChildItem, useCartStore, type CartItemAlternate} from '../stores/cart'
2525
import CartItemComponent from './CartItem.vue'
2626

2727
const props = defineProps<{
@@ -70,7 +70,6 @@ function allowDrop(draggingNode: Node, dropNode: Node, type: AllowDropType) {
7070
* 6. 出:mixture拖干净,需要删掉mixture
7171
* 7. 入:有simple标签拖进free的simple标签,创建editing
7272
* 8. ~~出:alternate和editing移出,需要补一个weight~~ - 这个weight现在不丢了 所以不需要补
73-
* 9. 入:拖入 composite的非group应当套一层group
7473
*
7574
* 最后需要把parent改了,标签类型修正了
7675
*
@@ -101,15 +100,14 @@ function dropPostProcess(draggingNode: Node, dropNode: Node, type: NodeDropType)
101100
})
102101
}
103102
}
104-
} else if (draggingNode.data.parent?.type === 'composite'
105-
|| draggingNode.data.parent?.type === 'alternate'
103+
} else if (draggingNode.data.parent?.type === 'alternate'
106104
|| draggingNode.data.parent?.type === 'group') {
107105
// 6. 出:mixture拖干净,需要删掉mixture
108106
if (draggingNode.data.parent.children.length === 0) {
109107
cartStore.removeCartItem(props.direction, draggingNode.data.parent)
110108
} else if (draggingNode.data.parent?.type !== 'group' && draggingNode.data.parent.children.length === 1) {
111109
// 除 group 以外剩下一个就解散
112-
cartStore.dismissCartItem(props.direction, draggingNode.data.parent as CartItemComposition | CartItemAlternate)
110+
cartStore.dismissCartItem(props.direction, draggingNode.data.parent as CartItemAlternate)
113111
skipReParent = true
114112
}
115113
}
@@ -131,14 +129,6 @@ function dropPostProcess(draggingNode: Node, dropNode: Node, type: NodeDropType)
131129
const dropCartItem = dropNode.data as CartItemSimple
132130
// 7. 入:有simple标签拖进free的simple标签,创建editing
133131
cartStore.createMixtureFromTag(props.direction, dropCartItem)
134-
} else if (dropNode.data.type === 'composition' && type === 'inner') {
135-
const draggingCartItem = draggingNode.data as CartItemCompositionChild
136-
const dropCartItem = dropNode.data as CartItemComposition
137-
// 9. 入:拖入 composite的非group应当套一层group
138-
draggingCartItem.parent = dropCartItem
139-
if (draggingCartItem.type !== 'group') {
140-
cartStore.wrapCompositionChild(draggingCartItem)
141-
}
142132
} else if (dropNode.data.parent?.type === 'editing' && type !== 'inner') {
143133
const dropCartItem = dropNode.data as CartItemEditingChild
144134
if (dropCartItem.parent.children.length > 2) {
@@ -151,16 +141,7 @@ function dropPostProcess(draggingNode: Node, dropNode: Node, type: NodeDropType)
151141
cartStore.switchMixtureType(props.direction, dropCartItem.parent, 'alternate')
152142
}
153143
}
154-
} else if (dropNode.data.parent?.type === 'composition' && type !== 'inner') {
155-
const draggingCartItem = draggingNode.data as CartItemCompositionChild
156-
const dropCartItem = dropNode.data as CartItemCompositionChild
157-
// 9. 入:拖入 composite的非group应当套一层group
158-
draggingCartItem.parent = dropCartItem.parent
159-
if (draggingCartItem.type !== 'group') {
160-
cartStore.wrapCompositionChild(draggingCartItem)
161-
skipReParent = true
162-
}
163-
}
144+
}
164145

165146
if (!skipReParent) {
166147
if (type === 'before' || type === 'after') {

0 commit comments

Comments
 (0)