Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- README.md +3 -3
- __pycache__/app.cpython-310.pyc +0 -0
- requirements.txt +1 -1
- space.py +9 -3
- src/README.md +21 -2
- src/backend/gradio_promptweighting/templates/component/index.js +500 -487
- src/demo/space.py +9 -3
- src/pyproject.toml +2 -2
README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
|
2 |
---
|
3 |
tags: [gradio-custom-component,diffusion model,UI,text-to-image,prompt weighting,editor]
|
4 |
-
title: gradio_promptweighting V0.0.
|
5 |
-
colorFrom:
|
6 |
-
colorTo:
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
license: apache-2.0
|
|
|
1 |
|
2 |
---
|
3 |
tags: [gradio-custom-component,diffusion model,UI,text-to-image,prompt weighting,editor]
|
4 |
+
title: gradio_promptweighting V0.0.2
|
5 |
+
colorFrom: purple
|
6 |
+
colorTo: pink
|
7 |
sdk: docker
|
8 |
pinned: false
|
9 |
license: apache-2.0
|
__pycache__/app.cpython-310.pyc
CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
|
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
gradio_promptweighting==0.0.
|
|
|
1 |
+
gradio_promptweighting==0.0.2
|
space.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
from app import demo as app
|
4 |
import os
|
5 |
|
6 |
-
_docs = {'PromptWeighting': {'description': '
|
7 |
|
8 |
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
9 |
|
@@ -21,7 +21,7 @@ with gr.Blocks(
|
|
21 |
# `gradio_promptweighting`
|
22 |
|
23 |
<div style="display: flex; gap: 7px;">
|
24 |
-
<img alt="
|
25 |
</div>
|
26 |
|
27 |
Simple component for creating prompt weighting for real-time generation.
|
@@ -53,7 +53,13 @@ with gr.Blocks() as demo:
|
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
prompt = PromptWeighting(
|
56 |
-
value=[
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
)
|
58 |
btn = gr.Button("Update Prompt")
|
59 |
with gr.Column():
|
|
|
3 |
from app import demo as app
|
4 |
import os
|
5 |
|
6 |
+
_docs = {'PromptWeighting': {'description': 'Enables multi text input with a vertical drag to adjust the weight of each prompt.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
|
7 |
|
8 |
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
9 |
|
|
|
21 |
# `gradio_promptweighting`
|
22 |
|
23 |
<div style="display: flex; gap: 7px;">
|
24 |
+
<a href="https://pypi.org/project/gradio_promptweighting/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_promptweighting"></a>
|
25 |
</div>
|
26 |
|
27 |
Simple component for creating prompt weighting for real-time generation.
|
|
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
prompt = PromptWeighting(
|
56 |
+
value=[
|
57 |
+
{"prompt": "a cat", "scale": 1.5},
|
58 |
+
{"prompt": "a dog", "scale": 1},
|
59 |
+
{"prompt": "a bird", "scale": 0.5},
|
60 |
+
],
|
61 |
+
step=0.001,
|
62 |
+
info="Please drag up or down to adjust the weight of the prompt.",
|
63 |
)
|
64 |
btn = gr.Button("Update Prompt")
|
65 |
with gr.Column():
|
src/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
|
2 |
# `gradio_promptweighting`
|
3 |
-
<img alt="
|
4 |
|
5 |
Simple component for creating prompt weighting for real-time generation.
|
6 |
|
@@ -28,7 +28,13 @@ with gr.Blocks() as demo:
|
|
28 |
with gr.Row():
|
29 |
with gr.Column():
|
30 |
prompt = PromptWeighting(
|
31 |
-
value=[
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
)
|
33 |
btn = gr.Button("Update Prompt")
|
34 |
with gr.Column():
|
@@ -135,6 +141,19 @@ bool | None
|
|
135 |
<td align="left">if True, will display label.</td>
|
136 |
</tr>
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
<tr>
|
139 |
<td align="left"><code>scale</code></td>
|
140 |
<td align="left" style="width: 25%;">
|
|
|
1 |
|
2 |
# `gradio_promptweighting`
|
3 |
+
<a href="https://pypi.org/project/gradio_promptweighting/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_promptweighting"></a>
|
4 |
|
5 |
Simple component for creating prompt weighting for real-time generation.
|
6 |
|
|
|
28 |
with gr.Row():
|
29 |
with gr.Column():
|
30 |
prompt = PromptWeighting(
|
31 |
+
value=[
|
32 |
+
{"prompt": "a cat", "scale": 1.5},
|
33 |
+
{"prompt": "a dog", "scale": 1},
|
34 |
+
{"prompt": "a bird", "scale": 0.5},
|
35 |
+
],
|
36 |
+
step=0.001,
|
37 |
+
info="Please drag up or down to adjust the weight of the prompt.",
|
38 |
)
|
39 |
btn = gr.Button("Update Prompt")
|
40 |
with gr.Column():
|
|
|
141 |
<td align="left">if True, will display label.</td>
|
142 |
</tr>
|
143 |
|
144 |
+
<tr>
|
145 |
+
<td align="left"><code>info</code></td>
|
146 |
+
<td align="left" style="width: 25%;">
|
147 |
+
|
148 |
+
```python
|
149 |
+
str | None
|
150 |
+
```
|
151 |
+
|
152 |
+
</td>
|
153 |
+
<td align="left"><code>None</code></td>
|
154 |
+
<td align="left">None</td>
|
155 |
+
</tr>
|
156 |
+
|
157 |
<tr>
|
158 |
<td align="left"><code>scale</code></td>
|
159 |
<td align="left" style="width: 25%;">
|
src/backend/gradio_promptweighting/templates/component/index.js
CHANGED
@@ -13,8 +13,8 @@ const {
|
|
13 |
element: dn,
|
14 |
get_all_dirty_from_scope: mn,
|
15 |
get_slot_changes: hn,
|
16 |
-
get_spread_update:
|
17 |
-
init:
|
18 |
insert: bn,
|
19 |
safe_not_equal: wn,
|
20 |
set_dynamic_element_data: Ge,
|
@@ -141,7 +141,7 @@ function yn(e) {
|
|
141 |
), Ge(
|
142 |
/*tag*/
|
143 |
o[14]
|
144 |
-
)(t, r =
|
145 |
(!l || a & /*test_id*/
|
146 |
128) && { "data-testid": (
|
147 |
/*test_id*/
|
@@ -256,17 +256,17 @@ function kn(e) {
|
|
256 |
};
|
257 |
}
|
258 |
function Cn(e, t, n) {
|
259 |
-
let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: f = void 0 } = t, { elem_id: r = "" } = t, { elem_classes: o = [] } = t, { variant: a = "solid" } = t, { border_mode: u = "base" } = t, { padding:
|
260 |
-
const
|
261 |
-
if (
|
262 |
-
if (typeof
|
263 |
-
return
|
264 |
-
if (typeof
|
265 |
-
return
|
266 |
}
|
267 |
};
|
268 |
-
return e.$$set = (
|
269 |
-
"height" in
|
270 |
}, [
|
271 |
s,
|
272 |
f,
|
@@ -274,24 +274,24 @@ function Cn(e, t, n) {
|
|
274 |
o,
|
275 |
a,
|
276 |
u,
|
277 |
-
m,
|
278 |
d,
|
279 |
-
p,
|
280 |
-
b,
|
281 |
-
v,
|
282 |
-
w,
|
283 |
-
k,
|
284 |
-
g,
|
285 |
_,
|
|
|
|
|
|
|
|
|
286 |
C,
|
287 |
-
|
|
|
|
|
|
|
288 |
i,
|
289 |
l
|
290 |
];
|
291 |
}
|
292 |
class An extends an {
|
293 |
constructor(t) {
|
294 |
-
super(),
|
295 |
height: 0,
|
296 |
width: 1,
|
297 |
elem_id: 2,
|
@@ -408,7 +408,7 @@ const {
|
|
408 |
space: tl,
|
409 |
text: nl,
|
410 |
toggle_class: ie,
|
411 |
-
transition_in:
|
412 |
transition_out: qe,
|
413 |
update_slot_base: ll
|
414 |
} = window.__gradio__svelte__internal;
|
@@ -432,7 +432,7 @@ function Je(e) {
|
|
432 |
10 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
|
433 |
},
|
434 |
i(l) {
|
435 |
-
n || (
|
436 |
},
|
437 |
o(l) {
|
438 |
qe(t.$$.fragment, l), n = !1;
|
@@ -528,12 +528,12 @@ function sl(e) {
|
|
528 |
o[1] != null
|
529 |
), /*info*/
|
530 |
o[1] ? r ? (r.p(o, a), a & /*info*/
|
531 |
-
2 &&
|
532 |
r = null;
|
533 |
}), Zn());
|
534 |
},
|
535 |
i(o) {
|
536 |
-
i || (
|
537 |
},
|
538 |
o(o) {
|
539 |
qe(f, o), qe(r), i = !1;
|
@@ -949,98 +949,98 @@ function Oe(e, t, n, l) {
|
|
949 |
}
|
950 |
function $e(e, t = {}) {
|
951 |
const n = cl(e), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
|
952 |
-
let f, r, o, a = e, u = e,
|
953 |
-
function
|
954 |
-
u =
|
955 |
-
const
|
956 |
-
return e == null ||
|
957 |
-
if (
|
958 |
-
return
|
959 |
-
|
960 |
-
const
|
961 |
-
inv_mass:
|
962 |
-
opts:
|
963 |
settled: !0,
|
964 |
-
dt: (
|
965 |
-
},
|
966 |
-
return f =
|
967 |
-
})), new Promise((
|
968 |
r.promise.then(() => {
|
969 |
-
|
970 |
});
|
971 |
}));
|
972 |
}
|
973 |
-
const
|
974 |
-
set:
|
975 |
-
update: (
|
976 |
subscribe: n.subscribe,
|
977 |
stiffness: l,
|
978 |
damping: i,
|
979 |
precision: s
|
980 |
};
|
981 |
-
return
|
982 |
}
|
983 |
const {
|
984 |
SvelteComponent: _l,
|
985 |
append: O,
|
986 |
-
attr:
|
987 |
component_subscribe: et,
|
988 |
detach: dl,
|
989 |
element: ml,
|
990 |
init: hl,
|
991 |
-
insert:
|
992 |
noop: tt,
|
993 |
-
safe_not_equal:
|
994 |
set_style: Ce,
|
995 |
svg_element: U,
|
996 |
toggle_class: nt
|
997 |
} = window.__gradio__svelte__internal, { onMount: bl } = window.__gradio__svelte__internal;
|
998 |
function wl(e) {
|
999 |
-
let t, n, l, i, s, f, r, o, a, u,
|
1000 |
return {
|
1001 |
c() {
|
1002 |
-
t = ml("div"), n = U("svg"), l = U("g"), i = U("path"), s = U("path"), f = U("path"), r = U("path"), o = U("g"), a = U("path"), u = U("path"),
|
1003 |
e[1][0] + "px, " + /*$top*/
|
1004 |
-
e[1][1] + "px)"),
|
1005 |
e[2][0] + "px, " + /*$bottom*/
|
1006 |
-
e[2][1] + "px)"),
|
1007 |
t,
|
1008 |
"margin",
|
1009 |
/*margin*/
|
1010 |
e[0]
|
1011 |
);
|
1012 |
},
|
1013 |
-
m(
|
1014 |
-
|
1015 |
},
|
1016 |
-
p(
|
1017 |
-
|
1018 |
2 && Ce(l, "transform", "translate(" + /*$top*/
|
1019 |
-
|
1020 |
-
|
1021 |
4 && Ce(o, "transform", "translate(" + /*$bottom*/
|
1022 |
-
|
1023 |
-
|
1024 |
1 && nt(
|
1025 |
t,
|
1026 |
"margin",
|
1027 |
/*margin*/
|
1028 |
-
|
1029 |
);
|
1030 |
},
|
1031 |
i: tt,
|
1032 |
o: tt,
|
1033 |
-
d(
|
1034 |
-
|
1035 |
}
|
1036 |
};
|
1037 |
}
|
1038 |
function vl(e, t, n) {
|
1039 |
let l, i, { margin: s = !0 } = t;
|
1040 |
const f = $e([0, 0]);
|
1041 |
-
et(e, f, (
|
1042 |
const r = $e([0, 0]);
|
1043 |
-
et(e, r, (
|
1044 |
let o;
|
1045 |
async function a() {
|
1046 |
await Promise.all([f.set([125, 140]), r.set([-125, -140])]), await Promise.all([f.set([-125, 140]), r.set([125, -140])]), await Promise.all([f.set([-125, 0]), r.set([125, -0])]), await Promise.all([f.set([125, 0]), r.set([-125, 0])]);
|
@@ -1048,16 +1048,16 @@ function vl(e, t, n) {
|
|
1048 |
async function u() {
|
1049 |
await a(), o || u();
|
1050 |
}
|
1051 |
-
async function
|
1052 |
await Promise.all([f.set([125, 0]), r.set([-125, 0])]), u();
|
1053 |
}
|
1054 |
-
return bl(() => (
|
1055 |
-
"margin" in
|
1056 |
}, [s, l, i, f, r];
|
1057 |
}
|
1058 |
class yl extends _l {
|
1059 |
constructor(t) {
|
1060 |
-
super(), hl(this, t, vl, wl,
|
1061 |
}
|
1062 |
}
|
1063 |
const {
|
@@ -1070,7 +1070,7 @@ const {
|
|
1070 |
create_slot: Al,
|
1071 |
destroy_component: Sl,
|
1072 |
destroy_each: Ut,
|
1073 |
-
detach:
|
1074 |
element: Q,
|
1075 |
empty: de,
|
1076 |
ensure_array_like: Ve,
|
@@ -1078,7 +1078,7 @@ const {
|
|
1078 |
get_slot_changes: Ll,
|
1079 |
group_outros: Zt,
|
1080 |
init: El,
|
1081 |
-
insert:
|
1082 |
mount_component: ql,
|
1083 |
noop: Ue,
|
1084 |
safe_not_equal: Fl,
|
@@ -1119,7 +1119,7 @@ function zl(e) {
|
|
1119 |
t = Q("span"), l = q(n), i = W(), r && r.c(), G(t, "class", "error svelte-1yserjw");
|
1120 |
},
|
1121 |
m(o, a) {
|
1122 |
-
|
1123 |
},
|
1124 |
p(o, a) {
|
1125 |
(!s || a[0] & /*i18n*/
|
@@ -1151,7 +1151,7 @@ function zl(e) {
|
|
1151 |
_e(r, o), s = !1;
|
1152 |
},
|
1153 |
d(o) {
|
1154 |
-
o && (
|
1155 |
}
|
1156 |
};
|
1157 |
}
|
@@ -1162,45 +1162,45 @@ function Bl(e) {
|
|
1162 |
e[18] && /*show_progress*/
|
1163 |
e[6] === "full" && ot(e)
|
1164 |
);
|
1165 |
-
function
|
1166 |
if (
|
1167 |
/*progress*/
|
1168 |
-
|
1169 |
)
|
1170 |
return Il;
|
1171 |
if (
|
1172 |
/*queue_position*/
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
)
|
1177 |
return Rl;
|
1178 |
if (
|
1179 |
/*queue_position*/
|
1180 |
-
|
1181 |
)
|
1182 |
return Dl;
|
1183 |
}
|
1184 |
-
let
|
1185 |
/*timer*/
|
1186 |
e[5] && ut(e)
|
1187 |
);
|
1188 |
-
const
|
1189 |
-
function
|
1190 |
return (
|
1191 |
/*last_progress_level*/
|
1192 |
-
|
1193 |
/*show_progress*/
|
1194 |
-
|
1195 |
)
|
1196 |
);
|
1197 |
}
|
1198 |
-
~(s =
|
1199 |
-
let
|
1200 |
-
e[5] &&
|
1201 |
return {
|
1202 |
c() {
|
1203 |
-
u && u.c(), t = W(), n = Q("div"),
|
1204 |
n,
|
1205 |
"meta-text-center",
|
1206 |
/*variant*/
|
@@ -1212,41 +1212,41 @@ function Bl(e) {
|
|
1212 |
e[8] === "default"
|
1213 |
);
|
1214 |
},
|
1215 |
-
m(
|
1216 |
-
u && u.m(
|
1217 |
},
|
1218 |
-
p(
|
1219 |
/*variant*/
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
256) && D(
|
1225 |
n,
|
1226 |
"meta-text-center",
|
1227 |
/*variant*/
|
1228 |
-
|
1229 |
-
), (!a ||
|
1230 |
256) && D(
|
1231 |
n,
|
1232 |
"meta-text",
|
1233 |
/*variant*/
|
1234 |
-
|
1235 |
);
|
1236 |
-
let
|
1237 |
-
s =
|
1238 |
-
|
1239 |
-
}), Ot()), ~s ? (f =
|
1240 |
-
|
1241 |
},
|
1242 |
-
i(
|
1243 |
a || (ce(f), a = !0);
|
1244 |
},
|
1245 |
-
o(
|
1246 |
_e(f), a = !1;
|
1247 |
},
|
1248 |
-
d(
|
1249 |
-
|
1250 |
}
|
1251 |
};
|
1252 |
}
|
@@ -1258,7 +1258,7 @@ function ot(e) {
|
|
1258 |
t = Q("div"), G(t, "class", "eta-bar svelte-1yserjw"), ee(t, "transform", n);
|
1259 |
},
|
1260 |
m(l, i) {
|
1261 |
-
|
1262 |
},
|
1263 |
p(l, i) {
|
1264 |
i[0] & /*eta_level*/
|
@@ -1266,7 +1266,7 @@ function ot(e) {
|
|
1266 |
(l[17] || 0) * 100 - 100}%)`) && ee(t, "transform", n);
|
1267 |
},
|
1268 |
d(l) {
|
1269 |
-
l &&
|
1270 |
}
|
1271 |
};
|
1272 |
}
|
@@ -1277,11 +1277,11 @@ function Dl(e) {
|
|
1277 |
t = q("processing |");
|
1278 |
},
|
1279 |
m(n, l) {
|
1280 |
-
|
1281 |
},
|
1282 |
p: Ue,
|
1283 |
d(n) {
|
1284 |
-
n &&
|
1285 |
}
|
1286 |
};
|
1287 |
}
|
@@ -1298,7 +1298,7 @@ function Rl(e) {
|
|
1298 |
), f = q(" |");
|
1299 |
},
|
1300 |
m(r, o) {
|
1301 |
-
|
1302 |
},
|
1303 |
p(r, o) {
|
1304 |
o[0] & /*queue_position*/
|
@@ -1311,7 +1311,7 @@ function Rl(e) {
|
|
1311 |
);
|
1312 |
},
|
1313 |
d(r) {
|
1314 |
-
r && (
|
1315 |
}
|
1316 |
};
|
1317 |
}
|
@@ -1331,7 +1331,7 @@ function Il(e) {
|
|
1331 |
m(i, s) {
|
1332 |
for (let f = 0; f < l.length; f += 1)
|
1333 |
l[f] && l[f].m(i, s);
|
1334 |
-
|
1335 |
},
|
1336 |
p(i, s) {
|
1337 |
if (s[0] & /*progress*/
|
@@ -1351,7 +1351,7 @@ function Il(e) {
|
|
1351 |
}
|
1352 |
},
|
1353 |
d(i) {
|
1354 |
-
i &&
|
1355 |
}
|
1356 |
};
|
1357 |
}
|
@@ -1360,7 +1360,7 @@ function ft(e) {
|
|
1360 |
/*p*/
|
1361 |
e[38].unit + ""
|
1362 |
), l, i, s = " ", f;
|
1363 |
-
function r(u,
|
1364 |
return (
|
1365 |
/*p*/
|
1366 |
u[38].length != null ? Ul : Ol
|
@@ -1371,16 +1371,16 @@ function ft(e) {
|
|
1371 |
c() {
|
1372 |
a.c(), t = W(), l = q(n), i = q(" | "), f = q(s);
|
1373 |
},
|
1374 |
-
m(u,
|
1375 |
-
a.m(u,
|
1376 |
},
|
1377 |
-
p(u,
|
1378 |
-
o === (o = r(u)) && a ? a.p(u,
|
1379 |
128 && n !== (n = /*p*/
|
1380 |
u[38].unit + "") && R(l, n);
|
1381 |
},
|
1382 |
d(u) {
|
1383 |
-
u && (
|
1384 |
}
|
1385 |
};
|
1386 |
}
|
@@ -1394,7 +1394,7 @@ function Ol(e) {
|
|
1394 |
n = q(t);
|
1395 |
},
|
1396 |
m(l, i) {
|
1397 |
-
|
1398 |
},
|
1399 |
p(l, i) {
|
1400 |
i[0] & /*progress*/
|
@@ -1404,7 +1404,7 @@ function Ol(e) {
|
|
1404 |
) + "") && R(n, t);
|
1405 |
},
|
1406 |
d(l) {
|
1407 |
-
l &&
|
1408 |
}
|
1409 |
};
|
1410 |
}
|
@@ -1421,7 +1421,7 @@ function Ul(e) {
|
|
1421 |
n = q(t), l = q("/"), s = q(i);
|
1422 |
},
|
1423 |
m(f, r) {
|
1424 |
-
|
1425 |
},
|
1426 |
p(f, r) {
|
1427 |
r[0] & /*progress*/
|
@@ -1435,7 +1435,7 @@ function Ul(e) {
|
|
1435 |
) + "") && R(s, i);
|
1436 |
},
|
1437 |
d(f) {
|
1438 |
-
f && (
|
1439 |
}
|
1440 |
};
|
1441 |
}
|
@@ -1449,14 +1449,14 @@ function at(e) {
|
|
1449 |
n && n.c(), t = de();
|
1450 |
},
|
1451 |
m(l, i) {
|
1452 |
-
n && n.m(l, i),
|
1453 |
},
|
1454 |
p(l, i) {
|
1455 |
/*p*/
|
1456 |
l[38].index != null ? n ? n.p(l, i) : (n = ft(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
|
1457 |
},
|
1458 |
d(l) {
|
1459 |
-
l &&
|
1460 |
}
|
1461 |
};
|
1462 |
}
|
@@ -1474,7 +1474,7 @@ function ut(e) {
|
|
1474 |
), l = q(n), i = q("s");
|
1475 |
},
|
1476 |
m(s, f) {
|
1477 |
-
|
1478 |
},
|
1479 |
p(s, f) {
|
1480 |
f[0] & /*formatted_timer*/
|
@@ -1488,7 +1488,7 @@ function ut(e) {
|
|
1488 |
s[19]}` : "") && R(l, n);
|
1489 |
},
|
1490 |
d(s) {
|
1491 |
-
s && (
|
1492 |
}
|
1493 |
};
|
1494 |
}
|
@@ -1534,7 +1534,7 @@ function Hl(e) {
|
|
1534 |
t = Q("div"), n = Q("div"), r && r.c(), l = W(), i = Q("div"), s = Q("div"), G(n, "class", "progress-level-inner svelte-1yserjw"), G(s, "class", "progress-bar svelte-1yserjw"), ee(s, "width", f), G(i, "class", "progress-bar-wrap svelte-1yserjw"), G(t, "class", "progress-level svelte-1yserjw");
|
1535 |
},
|
1536 |
m(o, a) {
|
1537 |
-
|
1538 |
},
|
1539 |
p(o, a) {
|
1540 |
/*progress*/
|
@@ -1545,7 +1545,7 @@ function Hl(e) {
|
|
1545 |
i: Ue,
|
1546 |
o: Ue,
|
1547 |
d(o) {
|
1548 |
-
o &&
|
1549 |
}
|
1550 |
};
|
1551 |
}
|
@@ -1555,7 +1555,7 @@ function ct(e) {
|
|
1555 |
e[7]
|
1556 |
), l = [];
|
1557 |
for (let i = 0; i < n.length; i += 1)
|
1558 |
-
l[i] =
|
1559 |
return {
|
1560 |
c() {
|
1561 |
for (let i = 0; i < l.length; i += 1)
|
@@ -1565,7 +1565,7 @@ function ct(e) {
|
|
1565 |
m(i, s) {
|
1566 |
for (let f = 0; f < l.length; f += 1)
|
1567 |
l[f] && l[f].m(i, s);
|
1568 |
-
|
1569 |
},
|
1570 |
p(i, s) {
|
1571 |
if (s[0] & /*progress_level, progress*/
|
@@ -1577,7 +1577,7 @@ function ct(e) {
|
|
1577 |
let f;
|
1578 |
for (f = 0; f < n.length; f += 1) {
|
1579 |
const r = st(i, n, f);
|
1580 |
-
l[f] ? l[f].p(r, s) : (l[f] =
|
1581 |
}
|
1582 |
for (; f < l.length; f += 1)
|
1583 |
l[f].d(1);
|
@@ -1585,7 +1585,7 @@ function ct(e) {
|
|
1585 |
}
|
1586 |
},
|
1587 |
d(i) {
|
1588 |
-
i &&
|
1589 |
}
|
1590 |
};
|
1591 |
}
|
@@ -1613,7 +1613,7 @@ function _t(e) {
|
|
1613 |
s && s.c(), t = W(), f && f.c(), n = W(), r && r.c(), l = W(), o && o.c(), i = de();
|
1614 |
},
|
1615 |
m(a, u) {
|
1616 |
-
s && s.m(a, u),
|
1617 |
},
|
1618 |
p(a, u) {
|
1619 |
/*p*/
|
@@ -1627,7 +1627,7 @@ function _t(e) {
|
|
1627 |
a[14] != null ? o ? o.p(a, u) : (o = ht(a), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null);
|
1628 |
},
|
1629 |
d(a) {
|
1630 |
-
a && (
|
1631 |
}
|
1632 |
};
|
1633 |
}
|
@@ -1638,10 +1638,10 @@ function Xl(e) {
|
|
1638 |
t = q(" /");
|
1639 |
},
|
1640 |
m(n, l) {
|
1641 |
-
|
1642 |
},
|
1643 |
d(n) {
|
1644 |
-
n &&
|
1645 |
}
|
1646 |
};
|
1647 |
}
|
@@ -1655,7 +1655,7 @@ function dt(e) {
|
|
1655 |
n = q(t);
|
1656 |
},
|
1657 |
m(l, i) {
|
1658 |
-
|
1659 |
},
|
1660 |
p(l, i) {
|
1661 |
i[0] & /*progress*/
|
@@ -1663,7 +1663,7 @@ function dt(e) {
|
|
1663 |
l[38].desc + "") && R(n, t);
|
1664 |
},
|
1665 |
d(l) {
|
1666 |
-
l &&
|
1667 |
}
|
1668 |
};
|
1669 |
}
|
@@ -1674,10 +1674,10 @@ function mt(e) {
|
|
1674 |
t = q("-");
|
1675 |
},
|
1676 |
m(n, l) {
|
1677 |
-
|
1678 |
},
|
1679 |
d(n) {
|
1680 |
-
n &&
|
1681 |
}
|
1682 |
};
|
1683 |
}
|
@@ -1692,7 +1692,7 @@ function ht(e) {
|
|
1692 |
n = q(t), l = q("%");
|
1693 |
},
|
1694 |
m(i, s) {
|
1695 |
-
|
1696 |
},
|
1697 |
p(i, s) {
|
1698 |
s[0] & /*progress_level*/
|
@@ -1703,11 +1703,11 @@ function ht(e) {
|
|
1703 |
] || 0)).toFixed(1) + "") && R(n, t);
|
1704 |
},
|
1705 |
d(i) {
|
1706 |
-
i && (
|
1707 |
}
|
1708 |
};
|
1709 |
}
|
1710 |
-
function
|
1711 |
let t, n = (
|
1712 |
/*p*/
|
1713 |
(e[38].desc != null || /*progress_level*/
|
@@ -1722,7 +1722,7 @@ function pt(e) {
|
|
1722 |
n && n.c(), t = de();
|
1723 |
},
|
1724 |
m(l, i) {
|
1725 |
-
n && n.m(l, i),
|
1726 |
},
|
1727 |
p(l, i) {
|
1728 |
/*p*/
|
@@ -1734,11 +1734,11 @@ function pt(e) {
|
|
1734 |
] != null ? n ? n.p(l, i) : (n = _t(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
|
1735 |
},
|
1736 |
d(l) {
|
1737 |
-
l &&
|
1738 |
}
|
1739 |
};
|
1740 |
}
|
1741 |
-
function
|
1742 |
let t, n;
|
1743 |
return {
|
1744 |
c() {
|
@@ -1748,7 +1748,7 @@ function gt(e) {
|
|
1748 |
), G(t, "class", "loading svelte-1yserjw");
|
1749 |
},
|
1750 |
m(l, i) {
|
1751 |
-
|
1752 |
},
|
1753 |
p(l, i) {
|
1754 |
i[0] & /*loading_text*/
|
@@ -1759,7 +1759,7 @@ function gt(e) {
|
|
1759 |
);
|
1760 |
},
|
1761 |
d(l) {
|
1762 |
-
l &&
|
1763 |
}
|
1764 |
};
|
1765 |
}
|
@@ -1814,12 +1814,12 @@ function Yl(e) {
|
|
1814 |
);
|
1815 |
},
|
1816 |
m(a, u) {
|
1817 |
-
|
1818 |
},
|
1819 |
p(a, u) {
|
1820 |
-
let
|
1821 |
-
n = o(a), n ===
|
1822 |
-
r[
|
1823 |
}), Ot()), ~n ? (l = r[n], l ? l.p(a, u) : (l = r[n] = f[n](a), l.c()), ce(l, 1), l.m(t, null)) : l = null), (!s || u[0] & /*variant, show_progress*/
|
1824 |
320 && i !== (i = "wrap " + /*variant*/
|
1825 |
a[8] + " " + /*show_progress*/
|
@@ -1870,7 +1870,7 @@ function Yl(e) {
|
|
1870 |
_e(l), s = !1;
|
1871 |
},
|
1872 |
d(a) {
|
1873 |
-
a &&
|
1874 |
}
|
1875 |
};
|
1876 |
}
|
@@ -1892,47 +1892,47 @@ async function Kl(e, t = !0) {
|
|
1892 |
}
|
1893 |
}
|
1894 |
function Gl(e, t, n) {
|
1895 |
-
let l, { $$slots: i = {}, $$scope: s } = t, { i18n: f } = t, { eta: r = null } = t, { queue_position: o } = t, { queue_size: a } = t, { status: u } = t, { scroll_to_output:
|
1896 |
const ye = () => {
|
1897 |
-
n(0, r = n(26, T = n(19, j = null))), n(24,
|
1898 |
};
|
1899 |
function ke() {
|
1900 |
requestAnimationFrame(() => {
|
1901 |
-
n(25, F = (performance.now() -
|
1902 |
});
|
1903 |
}
|
1904 |
function he() {
|
1905 |
-
n(25, F = 0), n(0, r = n(26, T = n(19, j = null))),
|
1906 |
}
|
1907 |
Vl(() => {
|
1908 |
-
|
1909 |
});
|
1910 |
let j = null;
|
1911 |
-
function sn(
|
1912 |
-
lt[
|
1913 |
-
Y =
|
1914 |
});
|
1915 |
}
|
1916 |
-
function rn(
|
1917 |
-
lt[
|
1918 |
-
|
1919 |
});
|
1920 |
}
|
1921 |
-
return e.$$set = (
|
1922 |
-
"i18n" in
|
1923 |
}, e.$$.update = () => {
|
1924 |
e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
|
1925 |
-
218103809 && (r === null && n(0, r = T), r != null && T !== r && (n(27, M = (performance.now() -
|
1926 |
167772160 && n(17, me = M === null || M <= 0 || !F ? null : Math.min(F / M, 1)), e.$$.dirty[0] & /*progress*/
|
1927 |
-
128 &&
|
1928 |
-
114816 && (
|
1929 |
-
if (
|
1930 |
-
return
|
1931 |
-
if (
|
1932 |
-
return
|
1933 |
})) : n(14, H = null), H ? (n(15, X = H[H.length - 1]), Y && (X === 0 ? n(16, Y.style.transition = "0", Y) : n(16, Y.style.transition = "150ms", Y))) : n(15, X = void 0)), e.$$.dirty[0] & /*status*/
|
1934 |
16 && (u === "pending" ? ye() : he()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
|
1935 |
-
10493968 &&
|
1936 |
4194320, e.$$.dirty[0] & /*timer_diff*/
|
1937 |
33554432 && n(20, l = F.toFixed(1));
|
1938 |
}, [
|
@@ -1941,15 +1941,15 @@ function Gl(e, t, n) {
|
|
1941 |
o,
|
1942 |
a,
|
1943 |
u,
|
1944 |
-
|
1945 |
-
d,
|
1946 |
-
b,
|
1947 |
-
v,
|
1948 |
-
w,
|
1949 |
-
k,
|
1950 |
-
g,
|
1951 |
_,
|
|
|
|
|
|
|
|
|
|
|
1952 |
c,
|
|
|
1953 |
H,
|
1954 |
X,
|
1955 |
Y,
|
@@ -1957,10 +1957,10 @@ function Gl(e, t, n) {
|
|
1957 |
le,
|
1958 |
j,
|
1959 |
l,
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
F,
|
1965 |
T,
|
1966 |
M,
|
@@ -2175,7 +2175,7 @@ function mi(e) {
|
|
2175 |
function hi(e) {
|
2176 |
return this.selectAll(e == null ? di : mi(typeof e == "function" ? e : Gt(e)));
|
2177 |
}
|
2178 |
-
function
|
2179 |
typeof e != "function" && (e = oi(e));
|
2180 |
for (var t = this._groups, n = t.length, l = new Array(n), i = 0; i < n; ++i)
|
2181 |
for (var s = t[i], f = s.length, r = l[i] = [], o, a = 0; a < f; ++a)
|
@@ -2185,7 +2185,7 @@ function pi(e) {
|
|
2185 |
function Wt(e) {
|
2186 |
return new Array(e.length);
|
2187 |
}
|
2188 |
-
function
|
2189 |
return new I(this._enter || this._groups.map(Wt), this._parents);
|
2190 |
}
|
2191 |
function Te(e, t) {
|
@@ -2218,13 +2218,13 @@ function wi(e, t, n, l, i, s) {
|
|
2218 |
(r = t[f]) && (i[f] = r);
|
2219 |
}
|
2220 |
function vi(e, t, n, l, i, s, f) {
|
2221 |
-
var r, o, a = /* @__PURE__ */ new Map(), u = t.length,
|
2222 |
for (r = 0; r < u; ++r)
|
2223 |
-
(o = t[r]) && (
|
2224 |
-
for (r = 0; r <
|
2225 |
-
|
2226 |
for (r = 0; r < u; ++r)
|
2227 |
-
(o = t[r]) && a.get(
|
2228 |
}
|
2229 |
function yi(e) {
|
2230 |
return e.__data__;
|
@@ -2235,13 +2235,13 @@ function ki(e, t) {
|
|
2235 |
var n = t ? vi : wi, l = this._parents, i = this._groups;
|
2236 |
typeof e != "function" && (e = bi(e));
|
2237 |
for (var s = i.length, f = new Array(s), r = new Array(s), o = new Array(s), a = 0; a < s; ++a) {
|
2238 |
-
var u = l[a],
|
2239 |
-
n(u,
|
2240 |
-
for (var
|
2241 |
-
if (
|
2242 |
-
for (
|
2243 |
;
|
2244 |
-
|
2245 |
}
|
2246 |
}
|
2247 |
return f = new I(f, l), f._enter = r, f._exit = o, f;
|
@@ -2258,8 +2258,8 @@ function Si(e, t, n) {
|
|
2258 |
}
|
2259 |
function Ni(e) {
|
2260 |
for (var t = e.selection ? e.selection() : e, n = this._groups, l = t._groups, i = n.length, s = l.length, f = Math.min(i, s), r = new Array(i), o = 0; o < f; ++o)
|
2261 |
-
for (var a = n[o], u = l[o],
|
2262 |
-
(
|
2263 |
for (; o < i; ++o)
|
2264 |
r[o] = n[o];
|
2265 |
return new I(r, this._parents);
|
@@ -2272,8 +2272,8 @@ function Li() {
|
|
2272 |
}
|
2273 |
function Ei(e) {
|
2274 |
e || (e = qi);
|
2275 |
-
function t(
|
2276 |
-
return
|
2277 |
}
|
2278 |
for (var n = this._groups, l = n.length, i = new Array(l), s = 0; s < l; ++s) {
|
2279 |
for (var f = n[s], r = f.length, o = i[s] = new Array(r), a, u = 0; u < r; ++u)
|
@@ -2510,18 +2510,18 @@ function ms(e) {
|
|
2510 |
function hs() {
|
2511 |
return null;
|
2512 |
}
|
2513 |
-
function
|
2514 |
var n = typeof e == "function" ? e : Yt(e), l = t == null ? hs : typeof t == "function" ? t : Kt(t);
|
2515 |
return this.select(function() {
|
2516 |
return this.insertBefore(n.apply(this, arguments), l.apply(this, arguments) || null);
|
2517 |
});
|
2518 |
}
|
2519 |
-
function
|
2520 |
var e = this.parentNode;
|
2521 |
e && e.removeChild(this);
|
2522 |
}
|
2523 |
function bs() {
|
2524 |
-
return this.each(
|
2525 |
}
|
2526 |
function ws() {
|
2527 |
var e = this.cloneNode(!1), t = this.parentNode;
|
@@ -2622,9 +2622,9 @@ I.prototype = {
|
|
2622 |
selectAll: ri,
|
2623 |
selectChild: ci,
|
2624 |
selectChildren: hi,
|
2625 |
-
filter:
|
2626 |
data: ki,
|
2627 |
-
enter:
|
2628 |
exit: Ai,
|
2629 |
join: Si,
|
2630 |
merge: Ni,
|
@@ -2646,7 +2646,7 @@ I.prototype = {
|
|
2646 |
raise: cs,
|
2647 |
lower: ds,
|
2648 |
append: ms,
|
2649 |
-
insert:
|
2650 |
remove: bs,
|
2651 |
clone: ys,
|
2652 |
datum: ks,
|
@@ -2738,78 +2738,78 @@ function Us() {
|
|
2738 |
return navigator.maxTouchPoints || "ontouchstart" in this;
|
2739 |
}
|
2740 |
function Zs() {
|
2741 |
-
var e = Rs, t = Is, n = Os, l = Us, i = {}, s = Ht("start", "drag", "end"), f = 0, r, o, a, u,
|
2742 |
-
function
|
2743 |
-
|
2744 |
-
}
|
2745 |
-
function
|
2746 |
-
if (!(u || !e.call(this,
|
2747 |
-
var
|
2748 |
-
|
2749 |
}
|
2750 |
}
|
2751 |
-
function
|
2752 |
-
if (ue(
|
2753 |
-
var
|
2754 |
-
a =
|
2755 |
}
|
2756 |
-
i.mouse("drag",
|
2757 |
}
|
2758 |
-
function
|
2759 |
-
we(
|
2760 |
}
|
2761 |
-
function
|
2762 |
-
if (e.call(this,
|
2763 |
-
var
|
2764 |
-
for (F = 0; F <
|
2765 |
-
(T =
|
2766 |
}
|
2767 |
}
|
2768 |
-
function
|
2769 |
-
var
|
2770 |
-
for (
|
2771 |
-
(
|
2772 |
}
|
2773 |
-
function
|
2774 |
-
var
|
2775 |
for (u && clearTimeout(u), u = setTimeout(function() {
|
2776 |
u = null;
|
2777 |
-
}, 500),
|
2778 |
-
(
|
2779 |
-
}
|
2780 |
-
function
|
2781 |
-
var T = s.copy(), M = vt(F ||
|
2782 |
-
if ((X = n.call(
|
2783 |
-
sourceEvent:
|
2784 |
-
target:
|
2785 |
-
identifier:
|
2786 |
active: f,
|
2787 |
x: M[0],
|
2788 |
y: M[1],
|
2789 |
dx: 0,
|
2790 |
dy: 0,
|
2791 |
dispatch: T
|
2792 |
-
}),
|
2793 |
return me = X.x - M[0] || 0, H = X.y - M[1] || 0, function Y(le, ye, ke) {
|
2794 |
var he = M, j;
|
2795 |
switch (le) {
|
2796 |
case "start":
|
2797 |
-
i[
|
2798 |
break;
|
2799 |
case "end":
|
2800 |
-
delete i[
|
2801 |
case "drag":
|
2802 |
-
M = vt(ke || ye,
|
2803 |
break;
|
2804 |
}
|
2805 |
T.call(
|
2806 |
le,
|
2807 |
-
|
2808 |
new He(le, {
|
2809 |
sourceEvent: ye,
|
2810 |
subject: X,
|
2811 |
-
target:
|
2812 |
-
identifier:
|
2813 |
active: j,
|
2814 |
x: M[0] + me,
|
2815 |
y: M[1] + H,
|
@@ -2817,24 +2817,24 @@ function Zs() {
|
|
2817 |
dy: M[1] - he[1],
|
2818 |
dispatch: T
|
2819 |
}),
|
2820 |
-
|
2821 |
);
|
2822 |
};
|
2823 |
}
|
2824 |
-
return
|
2825 |
-
return arguments.length ? (e = typeof
|
2826 |
-
},
|
2827 |
-
return arguments.length ? (t = typeof
|
2828 |
-
},
|
2829 |
-
return arguments.length ? (n = typeof
|
2830 |
-
},
|
2831 |
-
return arguments.length ? (l = typeof
|
2832 |
-
},
|
2833 |
-
var
|
2834 |
-
return
|
2835 |
-
},
|
2836 |
-
return arguments.length ? (
|
2837 |
-
},
|
2838 |
}
|
2839 |
const {
|
2840 |
SvelteComponent: Hs,
|
@@ -2915,38 +2915,38 @@ function dr(e) {
|
|
2915 |
let t, n, l, i, s, f, r, o, a = (
|
2916 |
/*prompt*/
|
2917 |
e[0].scale.toFixed(1) + ""
|
2918 |
-
), u, m,
|
2919 |
-
return
|
2920 |
c() {
|
2921 |
-
t = Z("div"), n = Z("div"), l = Z("div"), i = Z("div"), s = Z("div"), f = Z("span"), r = Z("span"), o = Z("span"), u = fr(a),
|
2922 |
-
(e[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae"), St(
|
2923 |
14,
|
2924 |
/*prompt*/
|
2925 |
e[0].prompt.length + 1
|
2926 |
-
) + "ch + 2em) "), V(
|
2927 |
(e[1] || /*isHovering*/
|
2928 |
e[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae"), V(t, "class", "w-min flex flex-col group relative svelte-1wmphae");
|
2929 |
},
|
2930 |
-
m(
|
2931 |
-
lr(
|
2932 |
-
|
2933 |
/*prompt*/
|
2934 |
e[0].prompt
|
2935 |
-
), B(n,
|
2936 |
J(
|
2937 |
-
|
2938 |
"keypress",
|
2939 |
/*onKeyPress*/
|
2940 |
e[6]
|
2941 |
),
|
2942 |
J(
|
2943 |
-
|
2944 |
"input",
|
2945 |
/*input_input_handler*/
|
2946 |
e[11]
|
2947 |
),
|
2948 |
J(
|
2949 |
-
|
2950 |
"click",
|
2951 |
/*click_handler*/
|
2952 |
e[12]
|
@@ -2987,75 +2987,75 @@ function dr(e) {
|
|
2987 |
/*pointerenter_handler_1*/
|
2988 |
e[19]
|
2989 |
)
|
2990 |
-
],
|
2991 |
},
|
2992 |
-
p(
|
2993 |
-
(!
|
2994 |
1) && a !== (a = /*prompt*/
|
2995 |
-
|
2996 |
-
1 &&
|
2997 |
-
(
|
2998 |
-
1) && St(
|
2999 |
14,
|
3000 |
/*prompt*/
|
3001 |
-
|
3002 |
-
) + "ch + 2em) "),
|
3003 |
-
1 &&
|
3004 |
-
|
3005 |
-
|
3006 |
/*prompt*/
|
3007 |
-
|
3008 |
-
), (!
|
3009 |
-
10 &&
|
3010 |
-
(
|
3011 |
-
|
3012 |
},
|
3013 |
-
i(
|
3014 |
-
|
3015 |
},
|
3016 |
-
o(
|
3017 |
-
ur(
|
3018 |
},
|
3019 |
-
d(
|
3020 |
-
|
3021 |
}
|
3022 |
};
|
3023 |
}
|
3024 |
function mr(e, t, n) {
|
3025 |
let { prompt: l } = t, { min: i = 0 } = t, { max: s = 2 } = t, { step: f = 0.01 } = t, r, o = !1, a = !1;
|
3026 |
const u = _r();
|
3027 |
-
let
|
3028 |
cr(() => {
|
3029 |
-
const
|
3030 |
-
|
3031 |
}).on("drag", (F) => {
|
3032 |
const { dx: T, dy: M } = F;
|
3033 |
-
|
3034 |
}).on("end", (F) => {
|
3035 |
n(1, o = !1);
|
3036 |
});
|
3037 |
-
we(
|
3038 |
});
|
3039 |
-
function
|
3040 |
-
|
3041 |
}
|
3042 |
-
function
|
3043 |
-
Ct[
|
3044 |
-
r =
|
3045 |
});
|
3046 |
}
|
3047 |
-
function
|
3048 |
l.prompt = this.value, n(0, l);
|
3049 |
}
|
3050 |
-
const
|
3051 |
-
function
|
3052 |
-
Ct[
|
3053 |
-
|
3054 |
});
|
3055 |
}
|
3056 |
-
const
|
3057 |
-
return e.$$set = (
|
3058 |
-
"prompt" in
|
3059 |
}, e.$$.update = () => {
|
3060 |
e.$$.dirty & /*isDragging*/
|
3061 |
2 && (o ? document.body.classList.add("grabbing") : document.body.classList.remove("grabbing"));
|
@@ -3064,22 +3064,22 @@ function mr(e, t, n) {
|
|
3064 |
o,
|
3065 |
r,
|
3066 |
a,
|
3067 |
-
|
3068 |
u,
|
3069 |
-
|
3070 |
i,
|
3071 |
s,
|
3072 |
f,
|
3073 |
-
p,
|
3074 |
-
b,
|
3075 |
-
v,
|
3076 |
-
w,
|
3077 |
-
k,
|
3078 |
g,
|
3079 |
-
|
|
|
|
|
3080 |
C,
|
|
|
3081 |
c,
|
3082 |
-
|
|
|
|
|
3083 |
];
|
3084 |
}
|
3085 |
class hr extends xs {
|
@@ -3088,8 +3088,8 @@ class hr extends xs {
|
|
3088 |
}
|
3089 |
}
|
3090 |
const {
|
3091 |
-
SvelteComponent:
|
3092 |
-
append:
|
3093 |
attr: $,
|
3094 |
detach: br,
|
3095 |
init: wr,
|
@@ -3110,7 +3110,7 @@ function kr(e) {
|
|
3110 |
);
|
3111 |
},
|
3112 |
m(l, i) {
|
3113 |
-
vr(l, t, i),
|
3114 |
},
|
3115 |
p(l, [i]) {
|
3116 |
i & /*classNames*/
|
@@ -3134,7 +3134,7 @@ function Cr(e, t, n) {
|
|
3134 |
"classNames" in i && n(0, l = i.classNames);
|
3135 |
}, [l];
|
3136 |
}
|
3137 |
-
class Ar extends
|
3138 |
constructor(t) {
|
3139 |
super(), wr(this, t, Cr, kr, yr, { classNames: 0 });
|
3140 |
}
|
@@ -3142,7 +3142,7 @@ class Ar extends pr {
|
|
3142 |
const {
|
3143 |
SvelteComponent: Sr,
|
3144 |
add_flush_callback: Nr,
|
3145 |
-
append:
|
3146 |
attr: re,
|
3147 |
bind: Lr,
|
3148 |
binding_callbacks: Er,
|
@@ -3243,95 +3243,95 @@ function Pt(e) {
|
|
3243 |
);
|
3244 |
}
|
3245 |
function Rr(e) {
|
3246 |
-
let t, n, l, i, s, f, r, o, a, u,
|
3247 |
/*promptsList*/
|
3248 |
e[0]
|
3249 |
-
),
|
3250 |
-
for (let
|
3251 |
-
|
3252 |
-
const
|
3253 |
-
|
3254 |
});
|
3255 |
return s = new Ar({}), {
|
3256 |
c() {
|
3257 |
t = Ne("div");
|
3258 |
-
for (let
|
3259 |
-
|
3260 |
n = Ft(), l = Ne("div"), i = Ne("button"), tn(s.$$.fragment), f = Ft(), r = Ne("h2"), r.textContent = "Add Prompt", re(r, "class", "text-xs font-normal px-1 svelte-9vwpr1"), re(i, "title", "Add Concept"), re(i, "class", "flex items-center text-base text-black hover-text-cyan-500 dark:text-white svelte-9vwpr1"), re(l, "class", "flex flex-col gap-1 svelte-9vwpr1"), re(t, "class", o = "flex items-center gap-1 flex-wrap " + /*classNames*/
|
3261 |
e[1] + " svelte-9vwpr1");
|
3262 |
},
|
3263 |
-
m(
|
3264 |
-
Tr(
|
3265 |
-
for (let
|
3266 |
-
|
3267 |
-
|
3268 |
i,
|
3269 |
"click",
|
3270 |
/*click_handler*/
|
3271 |
e[10]
|
3272 |
), u = !0);
|
3273 |
},
|
3274 |
-
p(
|
3275 |
-
if (
|
3276 |
125) {
|
3277 |
-
|
3278 |
/*promptsList*/
|
3279 |
-
|
3280 |
);
|
3281 |
-
let
|
3282 |
-
for (
|
3283 |
-
const
|
3284 |
-
|
3285 |
}
|
3286 |
-
for (Pr(),
|
3287 |
-
|
3288 |
qr();
|
3289 |
}
|
3290 |
-
(!a ||
|
3291 |
2 && o !== (o = "flex items-center gap-1 flex-wrap " + /*classNames*/
|
3292 |
-
|
3293 |
},
|
3294 |
-
i(
|
3295 |
if (!a) {
|
3296 |
-
for (let
|
3297 |
-
be(
|
3298 |
-
be(s.$$.fragment,
|
3299 |
}
|
3300 |
},
|
3301 |
-
o(
|
3302 |
-
|
3303 |
-
for (let
|
3304 |
-
Pe(
|
3305 |
-
Pe(s.$$.fragment,
|
3306 |
},
|
3307 |
-
d(
|
3308 |
-
|
3309 |
}
|
3310 |
};
|
3311 |
}
|
3312 |
function Ir(e, t, n) {
|
3313 |
let { classNames: l = "" } = t, { promptsList: i = [] } = t, { min: s } = t, { max: f } = t, { step: r } = t;
|
3314 |
-
function o(
|
3315 |
-
n(0, i = i.filter((
|
3316 |
}
|
3317 |
-
function a(
|
3318 |
n(0, i = [
|
3319 |
...i,
|
3320 |
{
|
3321 |
id: fn(),
|
3322 |
prompt: "",
|
3323 |
scale: 1,
|
3324 |
-
negative:
|
3325 |
}
|
3326 |
]);
|
3327 |
}
|
3328 |
Dr();
|
3329 |
-
function u(
|
3330 |
-
v
|
3331 |
}
|
3332 |
-
const
|
3333 |
-
return e.$$set = (
|
3334 |
-
"classNames" in
|
3335 |
}, [
|
3336 |
i,
|
3337 |
l,
|
@@ -3341,9 +3341,9 @@ function Ir(e, t, n) {
|
|
3341 |
o,
|
3342 |
a,
|
3343 |
u,
|
|
|
3344 |
m,
|
3345 |
-
|
3346 |
-
d
|
3347 |
];
|
3348 |
}
|
3349 |
class Or extends Sr {
|
@@ -3397,7 +3397,7 @@ function Tt(e) {
|
|
3397 |
e[1].i18n
|
3398 |
) },
|
3399 |
/*loading_status*/
|
3400 |
-
e[
|
3401 |
];
|
3402 |
let i = {};
|
3403 |
for (let s = 0; s < l.length; s += 1)
|
@@ -3411,7 +3411,7 @@ function Tt(e) {
|
|
3411 |
},
|
3412 |
p(s, f) {
|
3413 |
const r = f & /*gradio, loading_status*/
|
3414 |
-
|
3415 |
f & /*gradio*/
|
3416 |
2 && { autoscroll: (
|
3417 |
/*gradio*/
|
@@ -3423,9 +3423,9 @@ function Tt(e) {
|
|
3423 |
s[1].i18n
|
3424 |
) },
|
3425 |
f & /*loading_status*/
|
3426 |
-
|
3427 |
/*loading_status*/
|
3428 |
-
s[
|
3429 |
)
|
3430 |
]) : {};
|
3431 |
t.$set(r);
|
@@ -3447,7 +3447,7 @@ function io(e) {
|
|
3447 |
c() {
|
3448 |
t = no(
|
3449 |
/*label*/
|
3450 |
-
e[
|
3451 |
);
|
3452 |
},
|
3453 |
m(n, l) {
|
@@ -3455,10 +3455,10 @@ function io(e) {
|
|
3455 |
},
|
3456 |
p(n, l) {
|
3457 |
l & /*label*/
|
3458 |
-
|
3459 |
t,
|
3460 |
/*label*/
|
3461 |
-
n[
|
3462 |
);
|
3463 |
},
|
3464 |
d(n) {
|
@@ -3469,34 +3469,37 @@ function io(e) {
|
|
3469 |
function so(e) {
|
3470 |
let t, n, l, i, s, f, r, o = (
|
3471 |
/*loading_status*/
|
3472 |
-
e[
|
3473 |
);
|
3474 |
l = new ol({
|
3475 |
props: {
|
3476 |
show_label: (
|
3477 |
/*show_label*/
|
3478 |
-
e[
|
|
|
|
|
|
|
|
|
3479 |
),
|
3480 |
-
info: void 0,
|
3481 |
$$slots: { default: [io] },
|
3482 |
$$scope: { ctx: e }
|
3483 |
}
|
3484 |
});
|
3485 |
-
function a(
|
3486 |
-
e[
|
3487 |
}
|
3488 |
let u = {
|
3489 |
min: (
|
3490 |
/*min*/
|
3491 |
-
e[
|
3492 |
),
|
3493 |
max: (
|
3494 |
/*max*/
|
3495 |
-
e[
|
3496 |
),
|
3497 |
step: (
|
3498 |
/*step*/
|
3499 |
-
e[
|
3500 |
),
|
3501 |
classNames: "py-5"
|
3502 |
};
|
@@ -3507,39 +3510,41 @@ function so(e) {
|
|
3507 |
c() {
|
3508 |
o && o.c(), t = Vt(), n = Jr("label"), ze(l.$$.fragment), i = Vt(), ze(s.$$.fragment), Yr(n, "class", "relative"), lo(n, "container", oo);
|
3509 |
},
|
3510 |
-
m(
|
3511 |
-
o && o.m(
|
3512 |
},
|
3513 |
-
p(
|
3514 |
/*loading_status*/
|
3515 |
-
|
3516 |
-
|
3517 |
o = null;
|
3518 |
}), Wr());
|
3519 |
-
const
|
3520 |
-
|
3521 |
-
|
3522 |
-
|
3523 |
-
|
3524 |
-
|
3525 |
-
|
3526 |
-
|
3527 |
-
m
|
3528 |
-
2048 && (
|
3529 |
-
|
3530 |
-
4096 && (
|
3531 |
-
|
3532 |
-
|
3533 |
-
|
|
|
|
|
3534 |
},
|
3535 |
-
i(
|
3536 |
-
r || (te(o), te(l.$$.fragment,
|
3537 |
},
|
3538 |
-
o(
|
3539 |
-
fe(o), fe(l.$$.fragment,
|
3540 |
},
|
3541 |
-
d(
|
3542 |
-
|
3543 |
}
|
3544 |
}
|
3545 |
);
|
@@ -3550,23 +3555,23 @@ function ro(e) {
|
|
3550 |
props: {
|
3551 |
visible: (
|
3552 |
/*visible*/
|
3553 |
-
e[
|
3554 |
),
|
3555 |
elem_id: (
|
3556 |
/*elem_id*/
|
3557 |
-
e[
|
3558 |
),
|
3559 |
elem_classes: (
|
3560 |
/*elem_classes*/
|
3561 |
-
e[
|
3562 |
),
|
3563 |
scale: (
|
3564 |
/*scale*/
|
3565 |
-
e[
|
3566 |
),
|
3567 |
min_width: (
|
3568 |
/*min_width*/
|
3569 |
-
e[
|
3570 |
),
|
3571 |
allow_overflow: !1,
|
3572 |
padding: !0,
|
@@ -3583,17 +3588,17 @@ function ro(e) {
|
|
3583 |
p(l, [i]) {
|
3584 |
const s = {};
|
3585 |
i & /*visible*/
|
3586 |
-
|
3587 |
-
l[
|
3588 |
-
|
3589 |
-
l[
|
3590 |
-
|
3591 |
-
l[
|
3592 |
-
|
3593 |
-
l[
|
3594 |
-
|
3595 |
-
l[
|
3596 |
-
|
3597 |
},
|
3598 |
i(l) {
|
3599 |
n || (te(t.$$.fragment, l), n = !0);
|
@@ -3608,60 +3613,62 @@ function ro(e) {
|
|
3608 |
}
|
3609 |
const oo = !1;
|
3610 |
function fo(e, t, n) {
|
3611 |
-
let { gradio: l } = t, {
|
3612 |
-
function
|
3613 |
-
l.dispatch("change",
|
3614 |
}
|
3615 |
-
function
|
3616 |
-
|
3617 |
}
|
3618 |
-
return e.$$set = (
|
3619 |
-
"gradio" in
|
3620 |
}, e.$$.update = () => {
|
3621 |
e.$$.dirty & /*value*/
|
3622 |
-
1 &&
|
3623 |
-
1 &&
|
3624 |
}, [
|
3625 |
-
|
3626 |
l,
|
3627 |
i,
|
3628 |
s,
|
3629 |
f,
|
3630 |
r,
|
3631 |
-
|
3632 |
-
m,
|
3633 |
-
h,
|
3634 |
d,
|
3635 |
-
|
3636 |
-
|
3637 |
g,
|
3638 |
-
|
3639 |
p,
|
3640 |
-
|
|
|
|
|
|
|
3641 |
v,
|
3642 |
-
|
3643 |
];
|
3644 |
}
|
3645 |
class ao extends Ur {
|
3646 |
constructor(t) {
|
3647 |
super(), $r(this, t, fo, ro, eo, {
|
3648 |
gradio: 1,
|
3649 |
-
|
3650 |
-
|
3651 |
-
|
3652 |
-
|
|
|
3653 |
value: 0,
|
3654 |
-
placeholder:
|
3655 |
-
show_label:
|
3656 |
-
scale:
|
3657 |
-
min_width:
|
3658 |
-
loading_status:
|
3659 |
-
value_is_output:
|
3660 |
-
interactive:
|
3661 |
-
rtl:
|
3662 |
-
min:
|
3663 |
-
max:
|
3664 |
-
step:
|
3665 |
});
|
3666 |
}
|
3667 |
get gradio() {
|
@@ -3670,26 +3677,32 @@ class ao extends Ur {
|
|
3670 |
set gradio(t) {
|
3671 |
this.$$set({ gradio: t }), P();
|
3672 |
}
|
3673 |
-
get
|
3674 |
return this.$$.ctx[2];
|
3675 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
3676 |
set label(t) {
|
3677 |
this.$$set({ label: t }), P();
|
3678 |
}
|
3679 |
get elem_id() {
|
3680 |
-
return this.$$.ctx[
|
3681 |
}
|
3682 |
set elem_id(t) {
|
3683 |
this.$$set({ elem_id: t }), P();
|
3684 |
}
|
3685 |
get elem_classes() {
|
3686 |
-
return this.$$.ctx[
|
3687 |
}
|
3688 |
set elem_classes(t) {
|
3689 |
this.$$set({ elem_classes: t }), P();
|
3690 |
}
|
3691 |
get visible() {
|
3692 |
-
return this.$$.ctx[
|
3693 |
}
|
3694 |
set visible(t) {
|
3695 |
this.$$set({ visible: t }), P();
|
@@ -3701,67 +3714,67 @@ class ao extends Ur {
|
|
3701 |
this.$$set({ value: t }), P();
|
3702 |
}
|
3703 |
get placeholder() {
|
3704 |
-
return this.$$.ctx[
|
3705 |
}
|
3706 |
set placeholder(t) {
|
3707 |
this.$$set({ placeholder: t }), P();
|
3708 |
}
|
3709 |
get show_label() {
|
3710 |
-
return this.$$.ctx[
|
3711 |
}
|
3712 |
set show_label(t) {
|
3713 |
this.$$set({ show_label: t }), P();
|
3714 |
}
|
3715 |
get scale() {
|
3716 |
-
return this.$$.ctx[
|
3717 |
}
|
3718 |
set scale(t) {
|
3719 |
this.$$set({ scale: t }), P();
|
3720 |
}
|
3721 |
get min_width() {
|
3722 |
-
return this.$$.ctx[
|
3723 |
}
|
3724 |
set min_width(t) {
|
3725 |
this.$$set({ min_width: t }), P();
|
3726 |
}
|
3727 |
get loading_status() {
|
3728 |
-
return this.$$.ctx[
|
3729 |
}
|
3730 |
set loading_status(t) {
|
3731 |
this.$$set({ loading_status: t }), P();
|
3732 |
}
|
3733 |
get value_is_output() {
|
3734 |
-
return this.$$.ctx[
|
3735 |
}
|
3736 |
set value_is_output(t) {
|
3737 |
this.$$set({ value_is_output: t }), P();
|
3738 |
}
|
3739 |
get interactive() {
|
3740 |
-
return this.$$.ctx[
|
3741 |
}
|
3742 |
set interactive(t) {
|
3743 |
this.$$set({ interactive: t }), P();
|
3744 |
}
|
3745 |
get rtl() {
|
3746 |
-
return this.$$.ctx[
|
3747 |
}
|
3748 |
set rtl(t) {
|
3749 |
this.$$set({ rtl: t }), P();
|
3750 |
}
|
3751 |
get min() {
|
3752 |
-
return this.$$.ctx[
|
3753 |
}
|
3754 |
set min(t) {
|
3755 |
this.$$set({ min: t }), P();
|
3756 |
}
|
3757 |
get max() {
|
3758 |
-
return this.$$.ctx[
|
3759 |
}
|
3760 |
set max(t) {
|
3761 |
this.$$set({ max: t }), P();
|
3762 |
}
|
3763 |
get step() {
|
3764 |
-
return this.$$.ctx[
|
3765 |
}
|
3766 |
set step(t) {
|
3767 |
this.$$set({ step: t }), P();
|
|
|
13 |
element: dn,
|
14 |
get_all_dirty_from_scope: mn,
|
15 |
get_slot_changes: hn,
|
16 |
+
get_spread_update: gn,
|
17 |
+
init: pn,
|
18 |
insert: bn,
|
19 |
safe_not_equal: wn,
|
20 |
set_dynamic_element_data: Ge,
|
|
|
141 |
), Ge(
|
142 |
/*tag*/
|
143 |
o[14]
|
144 |
+
)(t, r = gn(f, [
|
145 |
(!l || a & /*test_id*/
|
146 |
128) && { "data-testid": (
|
147 |
/*test_id*/
|
|
|
256 |
};
|
257 |
}
|
258 |
function Cn(e, t, n) {
|
259 |
+
let { $$slots: l = {}, $$scope: i } = t, { height: s = void 0 } = t, { width: f = void 0 } = t, { elem_id: r = "" } = t, { elem_classes: o = [] } = t, { variant: a = "solid" } = t, { border_mode: u = "base" } = t, { padding: d = !0 } = t, { type: m = "normal" } = t, { test_id: _ = void 0 } = t, { explicit_call: g = !1 } = t, { container: w = !0 } = t, { visible: y = !0 } = t, { allow_overflow: v = !0 } = t, { scale: C = null } = t, { min_width: p = 0 } = t, c = m === "fieldset" ? "fieldset" : "div";
|
260 |
+
const A = (h) => {
|
261 |
+
if (h !== void 0) {
|
262 |
+
if (typeof h == "number")
|
263 |
+
return h + "px";
|
264 |
+
if (typeof h == "string")
|
265 |
+
return h;
|
266 |
}
|
267 |
};
|
268 |
+
return e.$$set = (h) => {
|
269 |
+
"height" in h && n(0, s = h.height), "width" in h && n(1, f = h.width), "elem_id" in h && n(2, r = h.elem_id), "elem_classes" in h && n(3, o = h.elem_classes), "variant" in h && n(4, a = h.variant), "border_mode" in h && n(5, u = h.border_mode), "padding" in h && n(6, d = h.padding), "type" in h && n(16, m = h.type), "test_id" in h && n(7, _ = h.test_id), "explicit_call" in h && n(8, g = h.explicit_call), "container" in h && n(9, w = h.container), "visible" in h && n(10, y = h.visible), "allow_overflow" in h && n(11, v = h.allow_overflow), "scale" in h && n(12, C = h.scale), "min_width" in h && n(13, p = h.min_width), "$$scope" in h && n(17, i = h.$$scope);
|
270 |
}, [
|
271 |
s,
|
272 |
f,
|
|
|
274 |
o,
|
275 |
a,
|
276 |
u,
|
|
|
277 |
d,
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
_,
|
279 |
+
g,
|
280 |
+
w,
|
281 |
+
y,
|
282 |
+
v,
|
283 |
C,
|
284 |
+
p,
|
285 |
+
c,
|
286 |
+
A,
|
287 |
+
m,
|
288 |
i,
|
289 |
l
|
290 |
];
|
291 |
}
|
292 |
class An extends an {
|
293 |
constructor(t) {
|
294 |
+
super(), pn(this, t, Cn, kn, wn, {
|
295 |
height: 0,
|
296 |
width: 1,
|
297 |
elem_id: 2,
|
|
|
408 |
space: tl,
|
409 |
text: nl,
|
410 |
toggle_class: ie,
|
411 |
+
transition_in: pe,
|
412 |
transition_out: qe,
|
413 |
update_slot_base: ll
|
414 |
} = window.__gradio__svelte__internal;
|
|
|
432 |
10 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
|
433 |
},
|
434 |
i(l) {
|
435 |
+
n || (pe(t.$$.fragment, l), n = !0);
|
436 |
},
|
437 |
o(l) {
|
438 |
qe(t.$$.fragment, l), n = !1;
|
|
|
528 |
o[1] != null
|
529 |
), /*info*/
|
530 |
o[1] ? r ? (r.p(o, a), a & /*info*/
|
531 |
+
2 && pe(r, 1)) : (r = Je(o), r.c(), pe(r, 1), r.m(l.parentNode, l)) : r && (Qn(), qe(r, 1, 1, () => {
|
532 |
r = null;
|
533 |
}), Zn());
|
534 |
},
|
535 |
i(o) {
|
536 |
+
i || (pe(f, o), pe(r), i = !0);
|
537 |
},
|
538 |
o(o) {
|
539 |
qe(f, o), qe(r), i = !1;
|
|
|
949 |
}
|
950 |
function $e(e, t = {}) {
|
951 |
const n = cl(e), { stiffness: l = 0.15, damping: i = 0.8, precision: s = 0.01 } = t;
|
952 |
+
let f, r, o, a = e, u = e, d = 1, m = 0, _ = !1;
|
953 |
+
function g(y, v = {}) {
|
954 |
+
u = y;
|
955 |
+
const C = o = {};
|
956 |
+
return e == null || v.hard || w.stiffness >= 1 && w.damping >= 1 ? (_ = !0, f = je(), a = y, n.set(e = u), Promise.resolve()) : (v.soft && (m = 1 / ((v.soft === !0 ? 0.5 : +v.soft) * 60), d = 0), r || (f = je(), _ = !1, r = ul((p) => {
|
957 |
+
if (_)
|
958 |
+
return _ = !1, r = null, !1;
|
959 |
+
d = Math.min(d + m, 1);
|
960 |
+
const c = {
|
961 |
+
inv_mass: d,
|
962 |
+
opts: w,
|
963 |
settled: !0,
|
964 |
+
dt: (p - f) * 60 / 1e3
|
965 |
+
}, A = Oe(c, a, e, u);
|
966 |
+
return f = p, a = e, n.set(e = A), c.settled && (r = null), !c.settled;
|
967 |
+
})), new Promise((p) => {
|
968 |
r.promise.then(() => {
|
969 |
+
C === o && p();
|
970 |
});
|
971 |
}));
|
972 |
}
|
973 |
+
const w = {
|
974 |
+
set: g,
|
975 |
+
update: (y, v) => g(y(u, e), v),
|
976 |
subscribe: n.subscribe,
|
977 |
stiffness: l,
|
978 |
damping: i,
|
979 |
precision: s
|
980 |
};
|
981 |
+
return w;
|
982 |
}
|
983 |
const {
|
984 |
SvelteComponent: _l,
|
985 |
append: O,
|
986 |
+
attr: E,
|
987 |
component_subscribe: et,
|
988 |
detach: dl,
|
989 |
element: ml,
|
990 |
init: hl,
|
991 |
+
insert: gl,
|
992 |
noop: tt,
|
993 |
+
safe_not_equal: pl,
|
994 |
set_style: Ce,
|
995 |
svg_element: U,
|
996 |
toggle_class: nt
|
997 |
} = window.__gradio__svelte__internal, { onMount: bl } = window.__gradio__svelte__internal;
|
998 |
function wl(e) {
|
999 |
+
let t, n, l, i, s, f, r, o, a, u, d, m;
|
1000 |
return {
|
1001 |
c() {
|
1002 |
+
t = ml("div"), n = U("svg"), l = U("g"), i = U("path"), s = U("path"), f = U("path"), r = U("path"), o = U("g"), a = U("path"), u = U("path"), d = U("path"), m = U("path"), E(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), E(i, "fill", "#FF7C00"), E(i, "fill-opacity", "0.4"), E(i, "class", "svelte-43sxxs"), E(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), E(s, "fill", "#FF7C00"), E(s, "class", "svelte-43sxxs"), E(f, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), E(f, "fill", "#FF7C00"), E(f, "fill-opacity", "0.4"), E(f, "class", "svelte-43sxxs"), E(r, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), E(r, "fill", "#FF7C00"), E(r, "class", "svelte-43sxxs"), Ce(l, "transform", "translate(" + /*$top*/
|
1003 |
e[1][0] + "px, " + /*$top*/
|
1004 |
+
e[1][1] + "px)"), E(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), E(a, "fill", "#FF7C00"), E(a, "fill-opacity", "0.4"), E(a, "class", "svelte-43sxxs"), E(u, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), E(u, "fill", "#FF7C00"), E(u, "class", "svelte-43sxxs"), E(d, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), E(d, "fill", "#FF7C00"), E(d, "fill-opacity", "0.4"), E(d, "class", "svelte-43sxxs"), E(m, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), E(m, "fill", "#FF7C00"), E(m, "class", "svelte-43sxxs"), Ce(o, "transform", "translate(" + /*$bottom*/
|
1005 |
e[2][0] + "px, " + /*$bottom*/
|
1006 |
+
e[2][1] + "px)"), E(n, "viewBox", "-1200 -1200 3000 3000"), E(n, "fill", "none"), E(n, "xmlns", "http://www.w3.org/2000/svg"), E(n, "class", "svelte-43sxxs"), E(t, "class", "svelte-43sxxs"), nt(
|
1007 |
t,
|
1008 |
"margin",
|
1009 |
/*margin*/
|
1010 |
e[0]
|
1011 |
);
|
1012 |
},
|
1013 |
+
m(_, g) {
|
1014 |
+
gl(_, t, g), O(t, n), O(n, l), O(l, i), O(l, s), O(l, f), O(l, r), O(n, o), O(o, a), O(o, u), O(o, d), O(o, m);
|
1015 |
},
|
1016 |
+
p(_, [g]) {
|
1017 |
+
g & /*$top*/
|
1018 |
2 && Ce(l, "transform", "translate(" + /*$top*/
|
1019 |
+
_[1][0] + "px, " + /*$top*/
|
1020 |
+
_[1][1] + "px)"), g & /*$bottom*/
|
1021 |
4 && Ce(o, "transform", "translate(" + /*$bottom*/
|
1022 |
+
_[2][0] + "px, " + /*$bottom*/
|
1023 |
+
_[2][1] + "px)"), g & /*margin*/
|
1024 |
1 && nt(
|
1025 |
t,
|
1026 |
"margin",
|
1027 |
/*margin*/
|
1028 |
+
_[0]
|
1029 |
);
|
1030 |
},
|
1031 |
i: tt,
|
1032 |
o: tt,
|
1033 |
+
d(_) {
|
1034 |
+
_ && dl(t);
|
1035 |
}
|
1036 |
};
|
1037 |
}
|
1038 |
function vl(e, t, n) {
|
1039 |
let l, i, { margin: s = !0 } = t;
|
1040 |
const f = $e([0, 0]);
|
1041 |
+
et(e, f, (m) => n(1, l = m));
|
1042 |
const r = $e([0, 0]);
|
1043 |
+
et(e, r, (m) => n(2, i = m));
|
1044 |
let o;
|
1045 |
async function a() {
|
1046 |
await Promise.all([f.set([125, 140]), r.set([-125, -140])]), await Promise.all([f.set([-125, 140]), r.set([125, -140])]), await Promise.all([f.set([-125, 0]), r.set([125, -0])]), await Promise.all([f.set([125, 0]), r.set([-125, 0])]);
|
|
|
1048 |
async function u() {
|
1049 |
await a(), o || u();
|
1050 |
}
|
1051 |
+
async function d() {
|
1052 |
await Promise.all([f.set([125, 0]), r.set([-125, 0])]), u();
|
1053 |
}
|
1054 |
+
return bl(() => (d(), () => o = !0)), e.$$set = (m) => {
|
1055 |
+
"margin" in m && n(0, s = m.margin);
|
1056 |
}, [s, l, i, f, r];
|
1057 |
}
|
1058 |
class yl extends _l {
|
1059 |
constructor(t) {
|
1060 |
+
super(), hl(this, t, vl, wl, pl, { margin: 0 });
|
1061 |
}
|
1062 |
}
|
1063 |
const {
|
|
|
1070 |
create_slot: Al,
|
1071 |
destroy_component: Sl,
|
1072 |
destroy_each: Ut,
|
1073 |
+
detach: S,
|
1074 |
element: Q,
|
1075 |
empty: de,
|
1076 |
ensure_array_like: Ve,
|
|
|
1078 |
get_slot_changes: Ll,
|
1079 |
group_outros: Zt,
|
1080 |
init: El,
|
1081 |
+
insert: N,
|
1082 |
mount_component: ql,
|
1083 |
noop: Ue,
|
1084 |
safe_not_equal: Fl,
|
|
|
1119 |
t = Q("span"), l = q(n), i = W(), r && r.c(), G(t, "class", "error svelte-1yserjw");
|
1120 |
},
|
1121 |
m(o, a) {
|
1122 |
+
N(o, t, a), ne(t, l), N(o, i, a), r && r.m(o, a), s = !0;
|
1123 |
},
|
1124 |
p(o, a) {
|
1125 |
(!s || a[0] & /*i18n*/
|
|
|
1151 |
_e(r, o), s = !1;
|
1152 |
},
|
1153 |
d(o) {
|
1154 |
+
o && (S(t), S(i)), r && r.d(o);
|
1155 |
}
|
1156 |
};
|
1157 |
}
|
|
|
1162 |
e[18] && /*show_progress*/
|
1163 |
e[6] === "full" && ot(e)
|
1164 |
);
|
1165 |
+
function d(p, c) {
|
1166 |
if (
|
1167 |
/*progress*/
|
1168 |
+
p[7]
|
1169 |
)
|
1170 |
return Il;
|
1171 |
if (
|
1172 |
/*queue_position*/
|
1173 |
+
p[2] !== null && /*queue_size*/
|
1174 |
+
p[3] !== void 0 && /*queue_position*/
|
1175 |
+
p[2] >= 0
|
1176 |
)
|
1177 |
return Rl;
|
1178 |
if (
|
1179 |
/*queue_position*/
|
1180 |
+
p[2] === 0
|
1181 |
)
|
1182 |
return Dl;
|
1183 |
}
|
1184 |
+
let m = d(e), _ = m && m(e), g = (
|
1185 |
/*timer*/
|
1186 |
e[5] && ut(e)
|
1187 |
);
|
1188 |
+
const w = [Hl, Zl], y = [];
|
1189 |
+
function v(p, c) {
|
1190 |
return (
|
1191 |
/*last_progress_level*/
|
1192 |
+
p[15] != null ? 0 : (
|
1193 |
/*show_progress*/
|
1194 |
+
p[6] === "full" ? 1 : -1
|
1195 |
)
|
1196 |
);
|
1197 |
}
|
1198 |
+
~(s = v(e)) && (f = y[s] = w[s](e));
|
1199 |
+
let C = !/*timer*/
|
1200 |
+
e[5] && pt(e);
|
1201 |
return {
|
1202 |
c() {
|
1203 |
+
u && u.c(), t = W(), n = Q("div"), _ && _.c(), l = W(), g && g.c(), i = W(), f && f.c(), r = W(), C && C.c(), o = de(), G(n, "class", "progress-text svelte-1yserjw"), D(
|
1204 |
n,
|
1205 |
"meta-text-center",
|
1206 |
/*variant*/
|
|
|
1212 |
e[8] === "default"
|
1213 |
);
|
1214 |
},
|
1215 |
+
m(p, c) {
|
1216 |
+
u && u.m(p, c), N(p, t, c), N(p, n, c), _ && _.m(n, null), ne(n, l), g && g.m(n, null), N(p, i, c), ~s && y[s].m(p, c), N(p, r, c), C && C.m(p, c), N(p, o, c), a = !0;
|
1217 |
},
|
1218 |
+
p(p, c) {
|
1219 |
/*variant*/
|
1220 |
+
p[8] === "default" && /*show_eta_bar*/
|
1221 |
+
p[18] && /*show_progress*/
|
1222 |
+
p[6] === "full" ? u ? u.p(p, c) : (u = ot(p), u.c(), u.m(t.parentNode, t)) : u && (u.d(1), u = null), m === (m = d(p)) && _ ? _.p(p, c) : (_ && _.d(1), _ = m && m(p), _ && (_.c(), _.m(n, l))), /*timer*/
|
1223 |
+
p[5] ? g ? g.p(p, c) : (g = ut(p), g.c(), g.m(n, null)) : g && (g.d(1), g = null), (!a || c[0] & /*variant*/
|
1224 |
256) && D(
|
1225 |
n,
|
1226 |
"meta-text-center",
|
1227 |
/*variant*/
|
1228 |
+
p[8] === "center"
|
1229 |
+
), (!a || c[0] & /*variant*/
|
1230 |
256) && D(
|
1231 |
n,
|
1232 |
"meta-text",
|
1233 |
/*variant*/
|
1234 |
+
p[8] === "default"
|
1235 |
);
|
1236 |
+
let A = s;
|
1237 |
+
s = v(p), s === A ? ~s && y[s].p(p, c) : (f && (Zt(), _e(y[A], 1, 1, () => {
|
1238 |
+
y[A] = null;
|
1239 |
+
}), Ot()), ~s ? (f = y[s], f ? f.p(p, c) : (f = y[s] = w[s](p), f.c()), ce(f, 1), f.m(r.parentNode, r)) : f = null), /*timer*/
|
1240 |
+
p[5] ? C && (C.d(1), C = null) : C ? C.p(p, c) : (C = pt(p), C.c(), C.m(o.parentNode, o));
|
1241 |
},
|
1242 |
+
i(p) {
|
1243 |
a || (ce(f), a = !0);
|
1244 |
},
|
1245 |
+
o(p) {
|
1246 |
_e(f), a = !1;
|
1247 |
},
|
1248 |
+
d(p) {
|
1249 |
+
p && (S(t), S(n), S(i), S(r), S(o)), u && u.d(p), _ && _.d(), g && g.d(), ~s && y[s].d(p), C && C.d(p);
|
1250 |
}
|
1251 |
};
|
1252 |
}
|
|
|
1258 |
t = Q("div"), G(t, "class", "eta-bar svelte-1yserjw"), ee(t, "transform", n);
|
1259 |
},
|
1260 |
m(l, i) {
|
1261 |
+
N(l, t, i);
|
1262 |
},
|
1263 |
p(l, i) {
|
1264 |
i[0] & /*eta_level*/
|
|
|
1266 |
(l[17] || 0) * 100 - 100}%)`) && ee(t, "transform", n);
|
1267 |
},
|
1268 |
d(l) {
|
1269 |
+
l && S(t);
|
1270 |
}
|
1271 |
};
|
1272 |
}
|
|
|
1277 |
t = q("processing |");
|
1278 |
},
|
1279 |
m(n, l) {
|
1280 |
+
N(n, t, l);
|
1281 |
},
|
1282 |
p: Ue,
|
1283 |
d(n) {
|
1284 |
+
n && S(t);
|
1285 |
}
|
1286 |
};
|
1287 |
}
|
|
|
1298 |
), f = q(" |");
|
1299 |
},
|
1300 |
m(r, o) {
|
1301 |
+
N(r, t, o), N(r, l, o), N(r, i, o), N(r, s, o), N(r, f, o);
|
1302 |
},
|
1303 |
p(r, o) {
|
1304 |
o[0] & /*queue_position*/
|
|
|
1311 |
);
|
1312 |
},
|
1313 |
d(r) {
|
1314 |
+
r && (S(t), S(l), S(i), S(s), S(f));
|
1315 |
}
|
1316 |
};
|
1317 |
}
|
|
|
1331 |
m(i, s) {
|
1332 |
for (let f = 0; f < l.length; f += 1)
|
1333 |
l[f] && l[f].m(i, s);
|
1334 |
+
N(i, t, s);
|
1335 |
},
|
1336 |
p(i, s) {
|
1337 |
if (s[0] & /*progress*/
|
|
|
1351 |
}
|
1352 |
},
|
1353 |
d(i) {
|
1354 |
+
i && S(t), Ut(l, i);
|
1355 |
}
|
1356 |
};
|
1357 |
}
|
|
|
1360 |
/*p*/
|
1361 |
e[38].unit + ""
|
1362 |
), l, i, s = " ", f;
|
1363 |
+
function r(u, d) {
|
1364 |
return (
|
1365 |
/*p*/
|
1366 |
u[38].length != null ? Ul : Ol
|
|
|
1371 |
c() {
|
1372 |
a.c(), t = W(), l = q(n), i = q(" | "), f = q(s);
|
1373 |
},
|
1374 |
+
m(u, d) {
|
1375 |
+
a.m(u, d), N(u, t, d), N(u, l, d), N(u, i, d), N(u, f, d);
|
1376 |
},
|
1377 |
+
p(u, d) {
|
1378 |
+
o === (o = r(u)) && a ? a.p(u, d) : (a.d(1), a = o(u), a && (a.c(), a.m(t.parentNode, t))), d[0] & /*progress*/
|
1379 |
128 && n !== (n = /*p*/
|
1380 |
u[38].unit + "") && R(l, n);
|
1381 |
},
|
1382 |
d(u) {
|
1383 |
+
u && (S(t), S(l), S(i), S(f)), a.d(u);
|
1384 |
}
|
1385 |
};
|
1386 |
}
|
|
|
1394 |
n = q(t);
|
1395 |
},
|
1396 |
m(l, i) {
|
1397 |
+
N(l, n, i);
|
1398 |
},
|
1399 |
p(l, i) {
|
1400 |
i[0] & /*progress*/
|
|
|
1404 |
) + "") && R(n, t);
|
1405 |
},
|
1406 |
d(l) {
|
1407 |
+
l && S(n);
|
1408 |
}
|
1409 |
};
|
1410 |
}
|
|
|
1421 |
n = q(t), l = q("/"), s = q(i);
|
1422 |
},
|
1423 |
m(f, r) {
|
1424 |
+
N(f, n, r), N(f, l, r), N(f, s, r);
|
1425 |
},
|
1426 |
p(f, r) {
|
1427 |
r[0] & /*progress*/
|
|
|
1435 |
) + "") && R(s, i);
|
1436 |
},
|
1437 |
d(f) {
|
1438 |
+
f && (S(n), S(l), S(s));
|
1439 |
}
|
1440 |
};
|
1441 |
}
|
|
|
1449 |
n && n.c(), t = de();
|
1450 |
},
|
1451 |
m(l, i) {
|
1452 |
+
n && n.m(l, i), N(l, t, i);
|
1453 |
},
|
1454 |
p(l, i) {
|
1455 |
/*p*/
|
1456 |
l[38].index != null ? n ? n.p(l, i) : (n = ft(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
|
1457 |
},
|
1458 |
d(l) {
|
1459 |
+
l && S(t), n && n.d(l);
|
1460 |
}
|
1461 |
};
|
1462 |
}
|
|
|
1474 |
), l = q(n), i = q("s");
|
1475 |
},
|
1476 |
m(s, f) {
|
1477 |
+
N(s, t, f), N(s, l, f), N(s, i, f);
|
1478 |
},
|
1479 |
p(s, f) {
|
1480 |
f[0] & /*formatted_timer*/
|
|
|
1488 |
s[19]}` : "") && R(l, n);
|
1489 |
},
|
1490 |
d(s) {
|
1491 |
+
s && (S(t), S(l), S(i));
|
1492 |
}
|
1493 |
};
|
1494 |
}
|
|
|
1534 |
t = Q("div"), n = Q("div"), r && r.c(), l = W(), i = Q("div"), s = Q("div"), G(n, "class", "progress-level-inner svelte-1yserjw"), G(s, "class", "progress-bar svelte-1yserjw"), ee(s, "width", f), G(i, "class", "progress-bar-wrap svelte-1yserjw"), G(t, "class", "progress-level svelte-1yserjw");
|
1535 |
},
|
1536 |
m(o, a) {
|
1537 |
+
N(o, t, a), ne(t, n), r && r.m(n, null), ne(t, l), ne(t, i), ne(i, s), e[30](s);
|
1538 |
},
|
1539 |
p(o, a) {
|
1540 |
/*progress*/
|
|
|
1545 |
i: Ue,
|
1546 |
o: Ue,
|
1547 |
d(o) {
|
1548 |
+
o && S(t), r && r.d(), e[30](null);
|
1549 |
}
|
1550 |
};
|
1551 |
}
|
|
|
1555 |
e[7]
|
1556 |
), l = [];
|
1557 |
for (let i = 0; i < n.length; i += 1)
|
1558 |
+
l[i] = gt(st(e, n, i));
|
1559 |
return {
|
1560 |
c() {
|
1561 |
for (let i = 0; i < l.length; i += 1)
|
|
|
1565 |
m(i, s) {
|
1566 |
for (let f = 0; f < l.length; f += 1)
|
1567 |
l[f] && l[f].m(i, s);
|
1568 |
+
N(i, t, s);
|
1569 |
},
|
1570 |
p(i, s) {
|
1571 |
if (s[0] & /*progress_level, progress*/
|
|
|
1577 |
let f;
|
1578 |
for (f = 0; f < n.length; f += 1) {
|
1579 |
const r = st(i, n, f);
|
1580 |
+
l[f] ? l[f].p(r, s) : (l[f] = gt(r), l[f].c(), l[f].m(t.parentNode, t));
|
1581 |
}
|
1582 |
for (; f < l.length; f += 1)
|
1583 |
l[f].d(1);
|
|
|
1585 |
}
|
1586 |
},
|
1587 |
d(i) {
|
1588 |
+
i && S(t), Ut(l, i);
|
1589 |
}
|
1590 |
};
|
1591 |
}
|
|
|
1613 |
s && s.c(), t = W(), f && f.c(), n = W(), r && r.c(), l = W(), o && o.c(), i = de();
|
1614 |
},
|
1615 |
m(a, u) {
|
1616 |
+
s && s.m(a, u), N(a, t, u), f && f.m(a, u), N(a, n, u), r && r.m(a, u), N(a, l, u), o && o.m(a, u), N(a, i, u);
|
1617 |
},
|
1618 |
p(a, u) {
|
1619 |
/*p*/
|
|
|
1627 |
a[14] != null ? o ? o.p(a, u) : (o = ht(a), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null);
|
1628 |
},
|
1629 |
d(a) {
|
1630 |
+
a && (S(t), S(n), S(l), S(i)), s && s.d(a), f && f.d(a), r && r.d(a), o && o.d(a);
|
1631 |
}
|
1632 |
};
|
1633 |
}
|
|
|
1638 |
t = q(" /");
|
1639 |
},
|
1640 |
m(n, l) {
|
1641 |
+
N(n, t, l);
|
1642 |
},
|
1643 |
d(n) {
|
1644 |
+
n && S(t);
|
1645 |
}
|
1646 |
};
|
1647 |
}
|
|
|
1655 |
n = q(t);
|
1656 |
},
|
1657 |
m(l, i) {
|
1658 |
+
N(l, n, i);
|
1659 |
},
|
1660 |
p(l, i) {
|
1661 |
i[0] & /*progress*/
|
|
|
1663 |
l[38].desc + "") && R(n, t);
|
1664 |
},
|
1665 |
d(l) {
|
1666 |
+
l && S(n);
|
1667 |
}
|
1668 |
};
|
1669 |
}
|
|
|
1674 |
t = q("-");
|
1675 |
},
|
1676 |
m(n, l) {
|
1677 |
+
N(n, t, l);
|
1678 |
},
|
1679 |
d(n) {
|
1680 |
+
n && S(t);
|
1681 |
}
|
1682 |
};
|
1683 |
}
|
|
|
1692 |
n = q(t), l = q("%");
|
1693 |
},
|
1694 |
m(i, s) {
|
1695 |
+
N(i, n, s), N(i, l, s);
|
1696 |
},
|
1697 |
p(i, s) {
|
1698 |
s[0] & /*progress_level*/
|
|
|
1703 |
] || 0)).toFixed(1) + "") && R(n, t);
|
1704 |
},
|
1705 |
d(i) {
|
1706 |
+
i && (S(n), S(l));
|
1707 |
}
|
1708 |
};
|
1709 |
}
|
1710 |
+
function gt(e) {
|
1711 |
let t, n = (
|
1712 |
/*p*/
|
1713 |
(e[38].desc != null || /*progress_level*/
|
|
|
1722 |
n && n.c(), t = de();
|
1723 |
},
|
1724 |
m(l, i) {
|
1725 |
+
n && n.m(l, i), N(l, t, i);
|
1726 |
},
|
1727 |
p(l, i) {
|
1728 |
/*p*/
|
|
|
1734 |
] != null ? n ? n.p(l, i) : (n = _t(l), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
|
1735 |
},
|
1736 |
d(l) {
|
1737 |
+
l && S(t), n && n.d(l);
|
1738 |
}
|
1739 |
};
|
1740 |
}
|
1741 |
+
function pt(e) {
|
1742 |
let t, n;
|
1743 |
return {
|
1744 |
c() {
|
|
|
1748 |
), G(t, "class", "loading svelte-1yserjw");
|
1749 |
},
|
1750 |
m(l, i) {
|
1751 |
+
N(l, t, i), ne(t, n);
|
1752 |
},
|
1753 |
p(l, i) {
|
1754 |
i[0] & /*loading_text*/
|
|
|
1759 |
);
|
1760 |
},
|
1761 |
d(l) {
|
1762 |
+
l && S(t);
|
1763 |
}
|
1764 |
};
|
1765 |
}
|
|
|
1814 |
);
|
1815 |
},
|
1816 |
m(a, u) {
|
1817 |
+
N(a, t, u), ~n && r[n].m(t, null), e[31](t), s = !0;
|
1818 |
},
|
1819 |
p(a, u) {
|
1820 |
+
let d = n;
|
1821 |
+
n = o(a), n === d ? ~n && r[n].p(a, u) : (l && (Zt(), _e(r[d], 1, 1, () => {
|
1822 |
+
r[d] = null;
|
1823 |
}), Ot()), ~n ? (l = r[n], l ? l.p(a, u) : (l = r[n] = f[n](a), l.c()), ce(l, 1), l.m(t, null)) : l = null), (!s || u[0] & /*variant, show_progress*/
|
1824 |
320 && i !== (i = "wrap " + /*variant*/
|
1825 |
a[8] + " " + /*show_progress*/
|
|
|
1870 |
_e(l), s = !1;
|
1871 |
},
|
1872 |
d(a) {
|
1873 |
+
a && S(t), ~n && r[n].d(), e[31](null);
|
1874 |
}
|
1875 |
};
|
1876 |
}
|
|
|
1892 |
}
|
1893 |
}
|
1894 |
function Gl(e, t, n) {
|
1895 |
+
let l, { $$slots: i = {}, $$scope: s } = t, { i18n: f } = t, { eta: r = null } = t, { queue_position: o } = t, { queue_size: a } = t, { status: u } = t, { scroll_to_output: d = !1 } = t, { timer: m = !0 } = t, { show_progress: _ = "full" } = t, { message: g = null } = t, { progress: w = null } = t, { variant: y = "default" } = t, { loading_text: v = "Loading..." } = t, { absolute: C = !0 } = t, { translucent: p = !1 } = t, { border: c = !1 } = t, { autoscroll: A } = t, h, b = !1, L = 0, F = 0, T = null, M = null, me = 0, H = null, X, Y = null, le = !0;
|
1896 |
const ye = () => {
|
1897 |
+
n(0, r = n(26, T = n(19, j = null))), n(24, L = performance.now()), n(25, F = 0), b = !0, ke();
|
1898 |
};
|
1899 |
function ke() {
|
1900 |
requestAnimationFrame(() => {
|
1901 |
+
n(25, F = (performance.now() - L) / 1e3), b && ke();
|
1902 |
});
|
1903 |
}
|
1904 |
function he() {
|
1905 |
+
n(25, F = 0), n(0, r = n(26, T = n(19, j = null))), b && (b = !1);
|
1906 |
}
|
1907 |
Vl(() => {
|
1908 |
+
b && he();
|
1909 |
});
|
1910 |
let j = null;
|
1911 |
+
function sn(k) {
|
1912 |
+
lt[k ? "unshift" : "push"](() => {
|
1913 |
+
Y = k, n(16, Y), n(7, w), n(14, H), n(15, X);
|
1914 |
});
|
1915 |
}
|
1916 |
+
function rn(k) {
|
1917 |
+
lt[k ? "unshift" : "push"](() => {
|
1918 |
+
h = k, n(13, h);
|
1919 |
});
|
1920 |
}
|
1921 |
+
return e.$$set = (k) => {
|
1922 |
+
"i18n" in k && n(1, f = k.i18n), "eta" in k && n(0, r = k.eta), "queue_position" in k && n(2, o = k.queue_position), "queue_size" in k && n(3, a = k.queue_size), "status" in k && n(4, u = k.status), "scroll_to_output" in k && n(21, d = k.scroll_to_output), "timer" in k && n(5, m = k.timer), "show_progress" in k && n(6, _ = k.show_progress), "message" in k && n(22, g = k.message), "progress" in k && n(7, w = k.progress), "variant" in k && n(8, y = k.variant), "loading_text" in k && n(9, v = k.loading_text), "absolute" in k && n(10, C = k.absolute), "translucent" in k && n(11, p = k.translucent), "border" in k && n(12, c = k.border), "autoscroll" in k && n(23, A = k.autoscroll), "$$scope" in k && n(28, s = k.$$scope);
|
1923 |
}, e.$$.update = () => {
|
1924 |
e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
|
1925 |
+
218103809 && (r === null && n(0, r = T), r != null && T !== r && (n(27, M = (performance.now() - L) / 1e3 + r), n(19, j = M.toFixed(1)), n(26, T = r))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/
|
1926 |
167772160 && n(17, me = M === null || M <= 0 || !F ? null : Math.min(F / M, 1)), e.$$.dirty[0] & /*progress*/
|
1927 |
+
128 && w != null && n(18, le = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
|
1928 |
+
114816 && (w != null ? n(14, H = w.map((k) => {
|
1929 |
+
if (k.index != null && k.length != null)
|
1930 |
+
return k.index / k.length;
|
1931 |
+
if (k.progress != null)
|
1932 |
+
return k.progress;
|
1933 |
})) : n(14, H = null), H ? (n(15, X = H[H.length - 1]), Y && (X === 0 ? n(16, Y.style.transition = "0", Y) : n(16, Y.style.transition = "150ms", Y))) : n(15, X = void 0)), e.$$.dirty[0] & /*status*/
|
1934 |
16 && (u === "pending" ? ye() : he()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
|
1935 |
+
10493968 && h && d && (u === "pending" || u === "complete") && Kl(h, A), e.$$.dirty[0] & /*status, message*/
|
1936 |
4194320, e.$$.dirty[0] & /*timer_diff*/
|
1937 |
33554432 && n(20, l = F.toFixed(1));
|
1938 |
}, [
|
|
|
1941 |
o,
|
1942 |
a,
|
1943 |
u,
|
1944 |
+
m,
|
|
|
|
|
|
|
|
|
|
|
|
|
1945 |
_,
|
1946 |
+
w,
|
1947 |
+
y,
|
1948 |
+
v,
|
1949 |
+
C,
|
1950 |
+
p,
|
1951 |
c,
|
1952 |
+
h,
|
1953 |
H,
|
1954 |
X,
|
1955 |
Y,
|
|
|
1957 |
le,
|
1958 |
j,
|
1959 |
l,
|
1960 |
+
d,
|
1961 |
+
g,
|
1962 |
+
A,
|
1963 |
+
L,
|
1964 |
F,
|
1965 |
T,
|
1966 |
M,
|
|
|
2175 |
function hi(e) {
|
2176 |
return this.selectAll(e == null ? di : mi(typeof e == "function" ? e : Gt(e)));
|
2177 |
}
|
2178 |
+
function gi(e) {
|
2179 |
typeof e != "function" && (e = oi(e));
|
2180 |
for (var t = this._groups, n = t.length, l = new Array(n), i = 0; i < n; ++i)
|
2181 |
for (var s = t[i], f = s.length, r = l[i] = [], o, a = 0; a < f; ++a)
|
|
|
2185 |
function Wt(e) {
|
2186 |
return new Array(e.length);
|
2187 |
}
|
2188 |
+
function pi() {
|
2189 |
return new I(this._enter || this._groups.map(Wt), this._parents);
|
2190 |
}
|
2191 |
function Te(e, t) {
|
|
|
2218 |
(r = t[f]) && (i[f] = r);
|
2219 |
}
|
2220 |
function vi(e, t, n, l, i, s, f) {
|
2221 |
+
var r, o, a = /* @__PURE__ */ new Map(), u = t.length, d = s.length, m = new Array(u), _;
|
2222 |
for (r = 0; r < u; ++r)
|
2223 |
+
(o = t[r]) && (m[r] = _ = f.call(o, o.__data__, r, t) + "", a.has(_) ? i[r] = o : a.set(_, o));
|
2224 |
+
for (r = 0; r < d; ++r)
|
2225 |
+
_ = f.call(e, s[r], r, s) + "", (o = a.get(_)) ? (l[r] = o, o.__data__ = s[r], a.delete(_)) : n[r] = new Te(e, s[r]);
|
2226 |
for (r = 0; r < u; ++r)
|
2227 |
+
(o = t[r]) && a.get(m[r]) === o && (i[r] = o);
|
2228 |
}
|
2229 |
function yi(e) {
|
2230 |
return e.__data__;
|
|
|
2235 |
var n = t ? vi : wi, l = this._parents, i = this._groups;
|
2236 |
typeof e != "function" && (e = bi(e));
|
2237 |
for (var s = i.length, f = new Array(s), r = new Array(s), o = new Array(s), a = 0; a < s; ++a) {
|
2238 |
+
var u = l[a], d = i[a], m = d.length, _ = Ci(e.call(u, u && u.__data__, a, l)), g = _.length, w = r[a] = new Array(g), y = f[a] = new Array(g), v = o[a] = new Array(m);
|
2239 |
+
n(u, d, w, y, v, _, t);
|
2240 |
+
for (var C = 0, p = 0, c, A; C < g; ++C)
|
2241 |
+
if (c = w[C]) {
|
2242 |
+
for (C >= p && (p = C + 1); !(A = y[p]) && ++p < g; )
|
2243 |
;
|
2244 |
+
c._next = A || null;
|
2245 |
}
|
2246 |
}
|
2247 |
return f = new I(f, l), f._enter = r, f._exit = o, f;
|
|
|
2258 |
}
|
2259 |
function Ni(e) {
|
2260 |
for (var t = e.selection ? e.selection() : e, n = this._groups, l = t._groups, i = n.length, s = l.length, f = Math.min(i, s), r = new Array(i), o = 0; o < f; ++o)
|
2261 |
+
for (var a = n[o], u = l[o], d = a.length, m = r[o] = new Array(d), _, g = 0; g < d; ++g)
|
2262 |
+
(_ = a[g] || u[g]) && (m[g] = _);
|
2263 |
for (; o < i; ++o)
|
2264 |
r[o] = n[o];
|
2265 |
return new I(r, this._parents);
|
|
|
2272 |
}
|
2273 |
function Ei(e) {
|
2274 |
e || (e = qi);
|
2275 |
+
function t(d, m) {
|
2276 |
+
return d && m ? e(d.__data__, m.__data__) : !d - !m;
|
2277 |
}
|
2278 |
for (var n = this._groups, l = n.length, i = new Array(l), s = 0; s < l; ++s) {
|
2279 |
for (var f = n[s], r = f.length, o = i[s] = new Array(r), a, u = 0; u < r; ++u)
|
|
|
2510 |
function hs() {
|
2511 |
return null;
|
2512 |
}
|
2513 |
+
function gs(e, t) {
|
2514 |
var n = typeof e == "function" ? e : Yt(e), l = t == null ? hs : typeof t == "function" ? t : Kt(t);
|
2515 |
return this.select(function() {
|
2516 |
return this.insertBefore(n.apply(this, arguments), l.apply(this, arguments) || null);
|
2517 |
});
|
2518 |
}
|
2519 |
+
function ps() {
|
2520 |
var e = this.parentNode;
|
2521 |
e && e.removeChild(this);
|
2522 |
}
|
2523 |
function bs() {
|
2524 |
+
return this.each(ps);
|
2525 |
}
|
2526 |
function ws() {
|
2527 |
var e = this.cloneNode(!1), t = this.parentNode;
|
|
|
2622 |
selectAll: ri,
|
2623 |
selectChild: ci,
|
2624 |
selectChildren: hi,
|
2625 |
+
filter: gi,
|
2626 |
data: ki,
|
2627 |
+
enter: pi,
|
2628 |
exit: Ai,
|
2629 |
join: Si,
|
2630 |
merge: Ni,
|
|
|
2646 |
raise: cs,
|
2647 |
lower: ds,
|
2648 |
append: ms,
|
2649 |
+
insert: gs,
|
2650 |
remove: bs,
|
2651 |
clone: ys,
|
2652 |
datum: ks,
|
|
|
2738 |
return navigator.maxTouchPoints || "ontouchstart" in this;
|
2739 |
}
|
2740 |
function Zs() {
|
2741 |
+
var e = Rs, t = Is, n = Os, l = Us, i = {}, s = Ht("start", "drag", "end"), f = 0, r, o, a, u, d = 0;
|
2742 |
+
function m(c) {
|
2743 |
+
c.on("mousedown.drag", _).filter(l).on("touchstart.drag", y).on("touchmove.drag", v, zs).on("touchend.drag touchcancel.drag", C).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
2744 |
+
}
|
2745 |
+
function _(c, A) {
|
2746 |
+
if (!(u || !e.call(this, c, A))) {
|
2747 |
+
var h = p(this, t.call(this, c, A), c, A, "mouse");
|
2748 |
+
h && (we(c.view).on("mousemove.drag", g, ve).on("mouseup.drag", w, ve), Bs(c.view), Ie(c), a = !1, r = c.clientX, o = c.clientY, h("start", c));
|
2749 |
}
|
2750 |
}
|
2751 |
+
function g(c) {
|
2752 |
+
if (ue(c), !a) {
|
2753 |
+
var A = c.clientX - r, h = c.clientY - o;
|
2754 |
+
a = A * A + h * h > d;
|
2755 |
}
|
2756 |
+
i.mouse("drag", c);
|
2757 |
}
|
2758 |
+
function w(c) {
|
2759 |
+
we(c.view).on("mousemove.drag mouseup.drag", null), Ds(c.view, a), ue(c), i.mouse("end", c);
|
2760 |
}
|
2761 |
+
function y(c, A) {
|
2762 |
+
if (e.call(this, c, A)) {
|
2763 |
+
var h = c.changedTouches, b = t.call(this, c, A), L = h.length, F, T;
|
2764 |
+
for (F = 0; F < L; ++F)
|
2765 |
+
(T = p(this, b, c, A, h[F].identifier, h[F])) && (Ie(c), T("start", c, h[F]));
|
2766 |
}
|
2767 |
}
|
2768 |
+
function v(c) {
|
2769 |
+
var A = c.changedTouches, h = A.length, b, L;
|
2770 |
+
for (b = 0; b < h; ++b)
|
2771 |
+
(L = i[A[b].identifier]) && (ue(c), L("drag", c, A[b]));
|
2772 |
}
|
2773 |
+
function C(c) {
|
2774 |
+
var A = c.changedTouches, h = A.length, b, L;
|
2775 |
for (u && clearTimeout(u), u = setTimeout(function() {
|
2776 |
u = null;
|
2777 |
+
}, 500), b = 0; b < h; ++b)
|
2778 |
+
(L = i[A[b].identifier]) && (Ie(c), L("end", c, A[b]));
|
2779 |
+
}
|
2780 |
+
function p(c, A, h, b, L, F) {
|
2781 |
+
var T = s.copy(), M = vt(F || h, A), me, H, X;
|
2782 |
+
if ((X = n.call(c, new He("beforestart", {
|
2783 |
+
sourceEvent: h,
|
2784 |
+
target: m,
|
2785 |
+
identifier: L,
|
2786 |
active: f,
|
2787 |
x: M[0],
|
2788 |
y: M[1],
|
2789 |
dx: 0,
|
2790 |
dy: 0,
|
2791 |
dispatch: T
|
2792 |
+
}), b)) != null)
|
2793 |
return me = X.x - M[0] || 0, H = X.y - M[1] || 0, function Y(le, ye, ke) {
|
2794 |
var he = M, j;
|
2795 |
switch (le) {
|
2796 |
case "start":
|
2797 |
+
i[L] = Y, j = f++;
|
2798 |
break;
|
2799 |
case "end":
|
2800 |
+
delete i[L], --f;
|
2801 |
case "drag":
|
2802 |
+
M = vt(ke || ye, A), j = f;
|
2803 |
break;
|
2804 |
}
|
2805 |
T.call(
|
2806 |
le,
|
2807 |
+
c,
|
2808 |
new He(le, {
|
2809 |
sourceEvent: ye,
|
2810 |
subject: X,
|
2811 |
+
target: m,
|
2812 |
+
identifier: L,
|
2813 |
active: j,
|
2814 |
x: M[0] + me,
|
2815 |
y: M[1] + H,
|
|
|
2817 |
dy: M[1] - he[1],
|
2818 |
dispatch: T
|
2819 |
}),
|
2820 |
+
b
|
2821 |
);
|
2822 |
};
|
2823 |
}
|
2824 |
+
return m.filter = function(c) {
|
2825 |
+
return arguments.length ? (e = typeof c == "function" ? c : Se(!!c), m) : e;
|
2826 |
+
}, m.container = function(c) {
|
2827 |
+
return arguments.length ? (t = typeof c == "function" ? c : Se(c), m) : t;
|
2828 |
+
}, m.subject = function(c) {
|
2829 |
+
return arguments.length ? (n = typeof c == "function" ? c : Se(c), m) : n;
|
2830 |
+
}, m.touchable = function(c) {
|
2831 |
+
return arguments.length ? (l = typeof c == "function" ? c : Se(!!c), m) : l;
|
2832 |
+
}, m.on = function() {
|
2833 |
+
var c = s.on.apply(s, arguments);
|
2834 |
+
return c === s ? m : c;
|
2835 |
+
}, m.clickDistance = function(c) {
|
2836 |
+
return arguments.length ? (d = (c = +c) * c, m) : Math.sqrt(d);
|
2837 |
+
}, m;
|
2838 |
}
|
2839 |
const {
|
2840 |
SvelteComponent: Hs,
|
|
|
2915 |
let t, n, l, i, s, f, r, o, a = (
|
2916 |
/*prompt*/
|
2917 |
e[0].scale.toFixed(1) + ""
|
2918 |
+
), u, d, m, _, g, w, y, v, C, p, c, A;
|
2919 |
+
return v = new js({}), {
|
2920 |
c() {
|
2921 |
+
t = Z("div"), n = Z("div"), l = Z("div"), i = Z("div"), s = Z("div"), f = Z("span"), r = Z("span"), o = Z("span"), u = fr(a), d = Nt(), m = Z("div"), _ = Z("input"), w = Nt(), y = Z("button"), $s(v.$$.fragment), V(o, "class", "text-black svelte-1wmphae"), V(r, "class", "text-black svelte-1wmphae"), V(f, "class", "flex text-[0.5rem] font-mono text-black dark:group-hover:text-white svelte-1wmphae"), V(s, "class", "bottom-full p-1 svelte-1wmphae"), V(i, "class", "relative svelte-1wmphae"), V(l, "class", "absolute z-10 flex items-center justify-center w-[2.5em] svelte-1wmphae"), V(_, "type", "text"), V(_, "placeholder", "Prompt"), V(_, "class", g = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
|
2922 |
+
(e[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae"), St(_, "width", "calc(" + Math.max(
|
2923 |
14,
|
2924 |
/*prompt*/
|
2925 |
e[0].prompt.length + 1
|
2926 |
+
) + "ch + 2em) "), V(m, "class", "relative flex z-0 svelte-1wmphae"), V(y, "class", "absolute z-1 right-1 text text-black hover:text-red-500 invisible group-hover:visible svelte-1wmphae"), V(y, "title", "Remove prompt"), V(n, "class", C = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
|
2927 |
(e[1] || /*isHovering*/
|
2928 |
e[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae"), V(t, "class", "w-min flex flex-col group relative svelte-1wmphae");
|
2929 |
},
|
2930 |
+
m(h, b) {
|
2931 |
+
lr(h, t, b), B(t, n), B(n, l), B(l, i), B(i, s), B(s, f), B(f, r), B(r, o), B(o, u), B(n, d), B(n, m), B(m, _), e[10](_), At(
|
2932 |
+
_,
|
2933 |
/*prompt*/
|
2934 |
e[0].prompt
|
2935 |
+
), B(n, w), B(n, y), ir(v, y, null), e[13](t), p = !0, c || (A = [
|
2936 |
J(
|
2937 |
+
_,
|
2938 |
"keypress",
|
2939 |
/*onKeyPress*/
|
2940 |
e[6]
|
2941 |
),
|
2942 |
J(
|
2943 |
+
_,
|
2944 |
"input",
|
2945 |
/*input_input_handler*/
|
2946 |
e[11]
|
2947 |
),
|
2948 |
J(
|
2949 |
+
y,
|
2950 |
"click",
|
2951 |
/*click_handler*/
|
2952 |
e[12]
|
|
|
2987 |
/*pointerenter_handler_1*/
|
2988 |
e[19]
|
2989 |
)
|
2990 |
+
], c = !0);
|
2991 |
},
|
2992 |
+
p(h, [b]) {
|
2993 |
+
(!p || b & /*prompt*/
|
2994 |
1) && a !== (a = /*prompt*/
|
2995 |
+
h[0].scale.toFixed(1) + "") && or(u, a), (!p || b & /*prompt*/
|
2996 |
+
1 && g !== (g = "text-sm z-0 pl pr py-2 outline-none text-black " + /*prompt*/
|
2997 |
+
(h[0].neg_guidance ? "line-through" : "") + " svelte-1wmphae")) && V(_, "class", g), (!p || b & /*prompt*/
|
2998 |
+
1) && St(_, "width", "calc(" + Math.max(
|
2999 |
14,
|
3000 |
/*prompt*/
|
3001 |
+
h[0].prompt.length + 1
|
3002 |
+
) + "ch + 2em) "), b & /*prompt*/
|
3003 |
+
1 && _.value !== /*prompt*/
|
3004 |
+
h[0].prompt && At(
|
3005 |
+
_,
|
3006 |
/*prompt*/
|
3007 |
+
h[0].prompt
|
3008 |
+
), (!p || b & /*isDragging, isHovering*/
|
3009 |
+
10 && C !== (C = "flex justify-between items-center rounded-md overflow-hidden " + /*isDragging*/
|
3010 |
+
(h[1] || /*isHovering*/
|
3011 |
+
h[3] ? "select-none touch-manipulation" : "") + " svelte-1wmphae")) && V(n, "class", C);
|
3012 |
},
|
3013 |
+
i(h) {
|
3014 |
+
p || (ar(v.$$.fragment, h), p = !0);
|
3015 |
},
|
3016 |
+
o(h) {
|
3017 |
+
ur(v.$$.fragment, h), p = !1;
|
3018 |
},
|
3019 |
+
d(h) {
|
3020 |
+
h && tr(t), e[10](null), er(v), e[13](null), c = !1, sr(A);
|
3021 |
}
|
3022 |
};
|
3023 |
}
|
3024 |
function mr(e, t, n) {
|
3025 |
let { prompt: l } = t, { min: i = 0 } = t, { max: s = 2 } = t, { step: f = 0.01 } = t, r, o = !1, a = !1;
|
3026 |
const u = _r();
|
3027 |
+
let d = 0, m;
|
3028 |
cr(() => {
|
3029 |
+
const L = Zs().on("start", (F) => {
|
3030 |
+
d = l.scale, n(1, o = !0);
|
3031 |
}).on("drag", (F) => {
|
3032 |
const { dx: T, dy: M } = F;
|
3033 |
+
d -= M * f, d = Math.min(d, s), d = Math.max(d, i), n(0, l.scale = d, l);
|
3034 |
}).on("end", (F) => {
|
3035 |
n(1, o = !1);
|
3036 |
});
|
3037 |
+
we(m).call(L), r.focus();
|
3038 |
});
|
3039 |
+
function _(L) {
|
3040 |
+
L.key === "Enter" && u("add");
|
3041 |
}
|
3042 |
+
function g(L) {
|
3043 |
+
Ct[L ? "unshift" : "push"](() => {
|
3044 |
+
r = L, n(2, r);
|
3045 |
});
|
3046 |
}
|
3047 |
+
function w() {
|
3048 |
l.prompt = this.value, n(0, l);
|
3049 |
}
|
3050 |
+
const y = () => u("remove");
|
3051 |
+
function v(L) {
|
3052 |
+
Ct[L ? "unshift" : "push"](() => {
|
3053 |
+
m = L, n(4, m);
|
3054 |
});
|
3055 |
}
|
3056 |
+
const C = () => n(3, a = !0), p = () => n(3, a = !1), c = () => n(3, a = !1), A = () => n(3, a = !0), h = () => n(3, a = !1), b = () => n(3, a = !0);
|
3057 |
+
return e.$$set = (L) => {
|
3058 |
+
"prompt" in L && n(0, l = L.prompt), "min" in L && n(7, i = L.min), "max" in L && n(8, s = L.max), "step" in L && n(9, f = L.step);
|
3059 |
}, e.$$.update = () => {
|
3060 |
e.$$.dirty & /*isDragging*/
|
3061 |
2 && (o ? document.body.classList.add("grabbing") : document.body.classList.remove("grabbing"));
|
|
|
3064 |
o,
|
3065 |
r,
|
3066 |
a,
|
3067 |
+
m,
|
3068 |
u,
|
3069 |
+
_,
|
3070 |
i,
|
3071 |
s,
|
3072 |
f,
|
|
|
|
|
|
|
|
|
|
|
3073 |
g,
|
3074 |
+
w,
|
3075 |
+
y,
|
3076 |
+
v,
|
3077 |
C,
|
3078 |
+
p,
|
3079 |
c,
|
3080 |
+
A,
|
3081 |
+
h,
|
3082 |
+
b
|
3083 |
];
|
3084 |
}
|
3085 |
class hr extends xs {
|
|
|
3088 |
}
|
3089 |
}
|
3090 |
const {
|
3091 |
+
SvelteComponent: gr,
|
3092 |
+
append: pr,
|
3093 |
attr: $,
|
3094 |
detach: br,
|
3095 |
init: wr,
|
|
|
3110 |
);
|
3111 |
},
|
3112 |
m(l, i) {
|
3113 |
+
vr(l, t, i), pr(t, n);
|
3114 |
},
|
3115 |
p(l, [i]) {
|
3116 |
i & /*classNames*/
|
|
|
3134 |
"classNames" in i && n(0, l = i.classNames);
|
3135 |
}, [l];
|
3136 |
}
|
3137 |
+
class Ar extends gr {
|
3138 |
constructor(t) {
|
3139 |
super(), wr(this, t, Cr, kr, yr, { classNames: 0 });
|
3140 |
}
|
|
|
3142 |
const {
|
3143 |
SvelteComponent: Sr,
|
3144 |
add_flush_callback: Nr,
|
3145 |
+
append: ge,
|
3146 |
attr: re,
|
3147 |
bind: Lr,
|
3148 |
binding_callbacks: Er,
|
|
|
3243 |
);
|
3244 |
}
|
3245 |
function Rr(e) {
|
3246 |
+
let t, n, l, i, s, f, r, o, a, u, d, m = qt(
|
3247 |
/*promptsList*/
|
3248 |
e[0]
|
3249 |
+
), _ = [];
|
3250 |
+
for (let w = 0; w < m.length; w += 1)
|
3251 |
+
_[w] = Pt(Mt(e, m, w));
|
3252 |
+
const g = (w) => Pe(_[w], 1, 1, () => {
|
3253 |
+
_[w] = null;
|
3254 |
});
|
3255 |
return s = new Ar({}), {
|
3256 |
c() {
|
3257 |
t = Ne("div");
|
3258 |
+
for (let w = 0; w < _.length; w += 1)
|
3259 |
+
_[w].c();
|
3260 |
n = Ft(), l = Ne("div"), i = Ne("button"), tn(s.$$.fragment), f = Ft(), r = Ne("h2"), r.textContent = "Add Prompt", re(r, "class", "text-xs font-normal px-1 svelte-9vwpr1"), re(i, "title", "Add Concept"), re(i, "class", "flex items-center text-base text-black hover-text-cyan-500 dark:text-white svelte-9vwpr1"), re(l, "class", "flex flex-col gap-1 svelte-9vwpr1"), re(t, "class", o = "flex items-center gap-1 flex-wrap " + /*classNames*/
|
3261 |
e[1] + " svelte-9vwpr1");
|
3262 |
},
|
3263 |
+
m(w, y) {
|
3264 |
+
Tr(w, t, y);
|
3265 |
+
for (let v = 0; v < _.length; v += 1)
|
3266 |
+
_[v] && _[v].m(t, null);
|
3267 |
+
ge(t, n), ge(t, l), ge(l, i), ln(s, i, null), ge(i, f), ge(i, r), a = !0, u || (d = zr(
|
3268 |
i,
|
3269 |
"click",
|
3270 |
/*click_handler*/
|
3271 |
e[10]
|
3272 |
), u = !0);
|
3273 |
},
|
3274 |
+
p(w, [y]) {
|
3275 |
+
if (y & /*min, max, step, promptsList, removeConcept, addPrompt*/
|
3276 |
125) {
|
3277 |
+
m = qt(
|
3278 |
/*promptsList*/
|
3279 |
+
w[0]
|
3280 |
);
|
3281 |
+
let v;
|
3282 |
+
for (v = 0; v < m.length; v += 1) {
|
3283 |
+
const C = Mt(w, m, v);
|
3284 |
+
_[v] ? (_[v].p(C, y), be(_[v], 1)) : (_[v] = Pt(C), _[v].c(), be(_[v], 1), _[v].m(t, n));
|
3285 |
}
|
3286 |
+
for (Pr(), v = m.length; v < _.length; v += 1)
|
3287 |
+
g(v);
|
3288 |
qr();
|
3289 |
}
|
3290 |
+
(!a || y & /*classNames*/
|
3291 |
2 && o !== (o = "flex items-center gap-1 flex-wrap " + /*classNames*/
|
3292 |
+
w[1] + " svelte-9vwpr1")) && re(t, "class", o);
|
3293 |
},
|
3294 |
+
i(w) {
|
3295 |
if (!a) {
|
3296 |
+
for (let y = 0; y < m.length; y += 1)
|
3297 |
+
be(_[y]);
|
3298 |
+
be(s.$$.fragment, w), a = !0;
|
3299 |
}
|
3300 |
},
|
3301 |
+
o(w) {
|
3302 |
+
_ = _.filter(Boolean);
|
3303 |
+
for (let y = 0; y < _.length; y += 1)
|
3304 |
+
Pe(_[y]);
|
3305 |
+
Pe(s.$$.fragment, w), a = !1;
|
3306 |
},
|
3307 |
+
d(w) {
|
3308 |
+
w && Mr(t), Fr(_, w), nn(s), u = !1, d();
|
3309 |
}
|
3310 |
};
|
3311 |
}
|
3312 |
function Ir(e, t, n) {
|
3313 |
let { classNames: l = "" } = t, { promptsList: i = [] } = t, { min: s } = t, { max: f } = t, { step: r } = t;
|
3314 |
+
function o(g) {
|
3315 |
+
n(0, i = i.filter((w) => w.id !== g.id));
|
3316 |
}
|
3317 |
+
function a(g = !1) {
|
3318 |
n(0, i = [
|
3319 |
...i,
|
3320 |
{
|
3321 |
id: fn(),
|
3322 |
prompt: "",
|
3323 |
scale: 1,
|
3324 |
+
negative: g
|
3325 |
}
|
3326 |
]);
|
3327 |
}
|
3328 |
Dr();
|
3329 |
+
function u(g, w, y, v) {
|
3330 |
+
y[v] = g, n(0, i);
|
3331 |
}
|
3332 |
+
const d = (g) => o(g), m = () => a(), _ = () => a(!1);
|
3333 |
+
return e.$$set = (g) => {
|
3334 |
+
"classNames" in g && n(1, l = g.classNames), "promptsList" in g && n(0, i = g.promptsList), "min" in g && n(2, s = g.min), "max" in g && n(3, f = g.max), "step" in g && n(4, r = g.step);
|
3335 |
}, [
|
3336 |
i,
|
3337 |
l,
|
|
|
3341 |
o,
|
3342 |
a,
|
3343 |
u,
|
3344 |
+
d,
|
3345 |
m,
|
3346 |
+
_
|
|
|
3347 |
];
|
3348 |
}
|
3349 |
class Or extends Sr {
|
|
|
3397 |
e[1].i18n
|
3398 |
) },
|
3399 |
/*loading_status*/
|
3400 |
+
e[10]
|
3401 |
];
|
3402 |
let i = {};
|
3403 |
for (let s = 0; s < l.length; s += 1)
|
|
|
3411 |
},
|
3412 |
p(s, f) {
|
3413 |
const r = f & /*gradio, loading_status*/
|
3414 |
+
1026 ? jr(l, [
|
3415 |
f & /*gradio*/
|
3416 |
2 && { autoscroll: (
|
3417 |
/*gradio*/
|
|
|
3423 |
s[1].i18n
|
3424 |
) },
|
3425 |
f & /*loading_status*/
|
3426 |
+
1024 && Qr(
|
3427 |
/*loading_status*/
|
3428 |
+
s[10]
|
3429 |
)
|
3430 |
]) : {};
|
3431 |
t.$set(r);
|
|
|
3447 |
c() {
|
3448 |
t = no(
|
3449 |
/*label*/
|
3450 |
+
e[3]
|
3451 |
);
|
3452 |
},
|
3453 |
m(n, l) {
|
|
|
3455 |
},
|
3456 |
p(n, l) {
|
3457 |
l & /*label*/
|
3458 |
+
8 && to(
|
3459 |
t,
|
3460 |
/*label*/
|
3461 |
+
n[3]
|
3462 |
);
|
3463 |
},
|
3464 |
d(n) {
|
|
|
3469 |
function so(e) {
|
3470 |
let t, n, l, i, s, f, r, o = (
|
3471 |
/*loading_status*/
|
3472 |
+
e[10] && Tt(e)
|
3473 |
);
|
3474 |
l = new ol({
|
3475 |
props: {
|
3476 |
show_label: (
|
3477 |
/*show_label*/
|
3478 |
+
e[7]
|
3479 |
+
),
|
3480 |
+
info: (
|
3481 |
+
/*info*/
|
3482 |
+
e[2]
|
3483 |
),
|
|
|
3484 |
$$slots: { default: [io] },
|
3485 |
$$scope: { ctx: e }
|
3486 |
}
|
3487 |
});
|
3488 |
+
function a(d) {
|
3489 |
+
e[18](d);
|
3490 |
}
|
3491 |
let u = {
|
3492 |
min: (
|
3493 |
/*min*/
|
3494 |
+
e[11]
|
3495 |
),
|
3496 |
max: (
|
3497 |
/*max*/
|
3498 |
+
e[12]
|
3499 |
),
|
3500 |
step: (
|
3501 |
/*step*/
|
3502 |
+
e[13]
|
3503 |
),
|
3504 |
classNames: "py-5"
|
3505 |
};
|
|
|
3510 |
c() {
|
3511 |
o && o.c(), t = Vt(), n = Jr("label"), ze(l.$$.fragment), i = Vt(), ze(s.$$.fragment), Yr(n, "class", "relative"), lo(n, "container", oo);
|
3512 |
},
|
3513 |
+
m(d, m) {
|
3514 |
+
o && o.m(d, m), Ye(d, t, m), Ye(d, n, m), De(l, n, null), Hr(n, i), De(s, n, null), r = !0;
|
3515 |
},
|
3516 |
+
p(d, m) {
|
3517 |
/*loading_status*/
|
3518 |
+
d[10] ? o ? (o.p(d, m), m & /*loading_status*/
|
3519 |
+
1024 && te(o, 1)) : (o = Tt(d), o.c(), te(o, 1), o.m(t.parentNode, t)) : o && (xr(), fe(o, 1, 1, () => {
|
3520 |
o = null;
|
3521 |
}), Wr());
|
3522 |
+
const _ = {};
|
3523 |
+
m & /*show_label*/
|
3524 |
+
128 && (_.show_label = /*show_label*/
|
3525 |
+
d[7]), m & /*info*/
|
3526 |
+
4 && (_.info = /*info*/
|
3527 |
+
d[2]), m & /*$$scope, label*/
|
3528 |
+
8388616 && (_.$$scope = { dirty: m, ctx: d }), l.$set(_);
|
3529 |
+
const g = {};
|
3530 |
+
m & /*min*/
|
3531 |
+
2048 && (g.min = /*min*/
|
3532 |
+
d[11]), m & /*max*/
|
3533 |
+
4096 && (g.max = /*max*/
|
3534 |
+
d[12]), m & /*step*/
|
3535 |
+
8192 && (g.step = /*step*/
|
3536 |
+
d[13]), !f && m & /*value*/
|
3537 |
+
1 && (f = !0, g.promptsList = /*value*/
|
3538 |
+
d[0], Zr(() => f = !1)), s.$set(g);
|
3539 |
},
|
3540 |
+
i(d) {
|
3541 |
+
r || (te(o), te(l.$$.fragment, d), te(s.$$.fragment, d), r = !0);
|
3542 |
},
|
3543 |
+
o(d) {
|
3544 |
+
fe(o), fe(l.$$.fragment, d), fe(s.$$.fragment, d), r = !1;
|
3545 |
},
|
3546 |
+
d(d) {
|
3547 |
+
d && (Xe(t), Xe(n)), o && o.d(d), Be(l), Be(s);
|
3548 |
}
|
3549 |
}
|
3550 |
);
|
|
|
3555 |
props: {
|
3556 |
visible: (
|
3557 |
/*visible*/
|
3558 |
+
e[6]
|
3559 |
),
|
3560 |
elem_id: (
|
3561 |
/*elem_id*/
|
3562 |
+
e[4]
|
3563 |
),
|
3564 |
elem_classes: (
|
3565 |
/*elem_classes*/
|
3566 |
+
e[5]
|
3567 |
),
|
3568 |
scale: (
|
3569 |
/*scale*/
|
3570 |
+
e[8]
|
3571 |
),
|
3572 |
min_width: (
|
3573 |
/*min_width*/
|
3574 |
+
e[9]
|
3575 |
),
|
3576 |
allow_overflow: !1,
|
3577 |
padding: !0,
|
|
|
3588 |
p(l, [i]) {
|
3589 |
const s = {};
|
3590 |
i & /*visible*/
|
3591 |
+
64 && (s.visible = /*visible*/
|
3592 |
+
l[6]), i & /*elem_id*/
|
3593 |
+
16 && (s.elem_id = /*elem_id*/
|
3594 |
+
l[4]), i & /*elem_classes*/
|
3595 |
+
32 && (s.elem_classes = /*elem_classes*/
|
3596 |
+
l[5]), i & /*scale*/
|
3597 |
+
256 && (s.scale = /*scale*/
|
3598 |
+
l[8]), i & /*min_width*/
|
3599 |
+
512 && (s.min_width = /*min_width*/
|
3600 |
+
l[9]), i & /*$$scope, min, max, step, value, show_label, info, label, gradio, loading_status*/
|
3601 |
+
8404111 && (s.$$scope = { dirty: i, ctx: l }), t.$set(s);
|
3602 |
},
|
3603 |
i(l) {
|
3604 |
n || (te(t.$$.fragment, l), n = !0);
|
|
|
3613 |
}
|
3614 |
const oo = !1;
|
3615 |
function fo(e, t, n) {
|
3616 |
+
let { gradio: l } = t, { info: i = void 0 } = t, { label: s = "Prompt Weighting" } = t, { elem_id: f = "" } = t, { elem_classes: r = [] } = t, { visible: o = !0 } = t, { value: a = [] } = t, { placeholder: u = "" } = t, { show_label: d } = t, { scale: m = null } = t, { min_width: _ = void 0 } = t, { loading_status: g = void 0 } = t, { value_is_output: w = !1 } = t, { interactive: y } = t, { rtl: v = !1 } = t, { min: C = 0 } = t, { max: p = 2 } = t, { step: c = 0.01 } = t;
|
3617 |
+
function A() {
|
3618 |
+
l.dispatch("change", a), w || (l.dispatch("input"), l.dispatch("submit"));
|
3619 |
}
|
3620 |
+
function h(b) {
|
3621 |
+
a = b, n(0, a);
|
3622 |
}
|
3623 |
+
return e.$$set = (b) => {
|
3624 |
+
"gradio" in b && n(1, l = b.gradio), "info" in b && n(2, i = b.info), "label" in b && n(3, s = b.label), "elem_id" in b && n(4, f = b.elem_id), "elem_classes" in b && n(5, r = b.elem_classes), "visible" in b && n(6, o = b.visible), "value" in b && n(0, a = b.value), "placeholder" in b && n(14, u = b.placeholder), "show_label" in b && n(7, d = b.show_label), "scale" in b && n(8, m = b.scale), "min_width" in b && n(9, _ = b.min_width), "loading_status" in b && n(10, g = b.loading_status), "value_is_output" in b && n(15, w = b.value_is_output), "interactive" in b && n(16, y = b.interactive), "rtl" in b && n(17, v = b.rtl), "min" in b && n(11, C = b.min), "max" in b && n(12, p = b.max), "step" in b && n(13, c = b.step);
|
3625 |
}, e.$$.update = () => {
|
3626 |
e.$$.dirty & /*value*/
|
3627 |
+
1 && a === null && n(0, a = []), e.$$.dirty & /*value*/
|
3628 |
+
1 && A();
|
3629 |
}, [
|
3630 |
+
a,
|
3631 |
l,
|
3632 |
i,
|
3633 |
s,
|
3634 |
f,
|
3635 |
r,
|
3636 |
+
o,
|
|
|
|
|
3637 |
d,
|
3638 |
+
m,
|
3639 |
+
_,
|
3640 |
g,
|
3641 |
+
C,
|
3642 |
p,
|
3643 |
+
c,
|
3644 |
+
u,
|
3645 |
+
w,
|
3646 |
+
y,
|
3647 |
v,
|
3648 |
+
h
|
3649 |
];
|
3650 |
}
|
3651 |
class ao extends Ur {
|
3652 |
constructor(t) {
|
3653 |
super(), $r(this, t, fo, ro, eo, {
|
3654 |
gradio: 1,
|
3655 |
+
info: 2,
|
3656 |
+
label: 3,
|
3657 |
+
elem_id: 4,
|
3658 |
+
elem_classes: 5,
|
3659 |
+
visible: 6,
|
3660 |
value: 0,
|
3661 |
+
placeholder: 14,
|
3662 |
+
show_label: 7,
|
3663 |
+
scale: 8,
|
3664 |
+
min_width: 9,
|
3665 |
+
loading_status: 10,
|
3666 |
+
value_is_output: 15,
|
3667 |
+
interactive: 16,
|
3668 |
+
rtl: 17,
|
3669 |
+
min: 11,
|
3670 |
+
max: 12,
|
3671 |
+
step: 13
|
3672 |
});
|
3673 |
}
|
3674 |
get gradio() {
|
|
|
3677 |
set gradio(t) {
|
3678 |
this.$$set({ gradio: t }), P();
|
3679 |
}
|
3680 |
+
get info() {
|
3681 |
return this.$$.ctx[2];
|
3682 |
}
|
3683 |
+
set info(t) {
|
3684 |
+
this.$$set({ info: t }), P();
|
3685 |
+
}
|
3686 |
+
get label() {
|
3687 |
+
return this.$$.ctx[3];
|
3688 |
+
}
|
3689 |
set label(t) {
|
3690 |
this.$$set({ label: t }), P();
|
3691 |
}
|
3692 |
get elem_id() {
|
3693 |
+
return this.$$.ctx[4];
|
3694 |
}
|
3695 |
set elem_id(t) {
|
3696 |
this.$$set({ elem_id: t }), P();
|
3697 |
}
|
3698 |
get elem_classes() {
|
3699 |
+
return this.$$.ctx[5];
|
3700 |
}
|
3701 |
set elem_classes(t) {
|
3702 |
this.$$set({ elem_classes: t }), P();
|
3703 |
}
|
3704 |
get visible() {
|
3705 |
+
return this.$$.ctx[6];
|
3706 |
}
|
3707 |
set visible(t) {
|
3708 |
this.$$set({ visible: t }), P();
|
|
|
3714 |
this.$$set({ value: t }), P();
|
3715 |
}
|
3716 |
get placeholder() {
|
3717 |
+
return this.$$.ctx[14];
|
3718 |
}
|
3719 |
set placeholder(t) {
|
3720 |
this.$$set({ placeholder: t }), P();
|
3721 |
}
|
3722 |
get show_label() {
|
3723 |
+
return this.$$.ctx[7];
|
3724 |
}
|
3725 |
set show_label(t) {
|
3726 |
this.$$set({ show_label: t }), P();
|
3727 |
}
|
3728 |
get scale() {
|
3729 |
+
return this.$$.ctx[8];
|
3730 |
}
|
3731 |
set scale(t) {
|
3732 |
this.$$set({ scale: t }), P();
|
3733 |
}
|
3734 |
get min_width() {
|
3735 |
+
return this.$$.ctx[9];
|
3736 |
}
|
3737 |
set min_width(t) {
|
3738 |
this.$$set({ min_width: t }), P();
|
3739 |
}
|
3740 |
get loading_status() {
|
3741 |
+
return this.$$.ctx[10];
|
3742 |
}
|
3743 |
set loading_status(t) {
|
3744 |
this.$$set({ loading_status: t }), P();
|
3745 |
}
|
3746 |
get value_is_output() {
|
3747 |
+
return this.$$.ctx[15];
|
3748 |
}
|
3749 |
set value_is_output(t) {
|
3750 |
this.$$set({ value_is_output: t }), P();
|
3751 |
}
|
3752 |
get interactive() {
|
3753 |
+
return this.$$.ctx[16];
|
3754 |
}
|
3755 |
set interactive(t) {
|
3756 |
this.$$set({ interactive: t }), P();
|
3757 |
}
|
3758 |
get rtl() {
|
3759 |
+
return this.$$.ctx[17];
|
3760 |
}
|
3761 |
set rtl(t) {
|
3762 |
this.$$set({ rtl: t }), P();
|
3763 |
}
|
3764 |
get min() {
|
3765 |
+
return this.$$.ctx[11];
|
3766 |
}
|
3767 |
set min(t) {
|
3768 |
this.$$set({ min: t }), P();
|
3769 |
}
|
3770 |
get max() {
|
3771 |
+
return this.$$.ctx[12];
|
3772 |
}
|
3773 |
set max(t) {
|
3774 |
this.$$set({ max: t }), P();
|
3775 |
}
|
3776 |
get step() {
|
3777 |
+
return this.$$.ctx[13];
|
3778 |
}
|
3779 |
set step(t) {
|
3780 |
this.$$set({ step: t }), P();
|
src/demo/space.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
from app import demo as app
|
4 |
import os
|
5 |
|
6 |
-
_docs = {'PromptWeighting': {'description': '
|
7 |
|
8 |
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
9 |
|
@@ -21,7 +21,7 @@ with gr.Blocks(
|
|
21 |
# `gradio_promptweighting`
|
22 |
|
23 |
<div style="display: flex; gap: 7px;">
|
24 |
-
<img alt="
|
25 |
</div>
|
26 |
|
27 |
Simple component for creating prompt weighting for real-time generation.
|
@@ -53,7 +53,13 @@ with gr.Blocks() as demo:
|
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
prompt = PromptWeighting(
|
56 |
-
value=[
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
)
|
58 |
btn = gr.Button("Update Prompt")
|
59 |
with gr.Column():
|
|
|
3 |
from app import demo as app
|
4 |
import os
|
5 |
|
6 |
+
_docs = {'PromptWeighting': {'description': 'Enables multi text input with a vertical drag to adjust the weight of each prompt.', 'members': {'__init__': {'value': {'type': 'str | dict | list | Callable | None', 'default': 'None', 'description': 'default text to provide in textbox. If callable, the function will be called whenever the app loads to set the initial value of the component.'}, 'placeholder': {'type': 'str | None', 'default': 'None', 'description': 'placeholder hint to provide behind textbox.'}, 'label': {'type': 'str | None', 'default': 'None', 'description': 'component name in interface.'}, 'every': {'type': 'float | None', 'default': 'None', 'description': "If `value` is a callable, run the function 'every' number of seconds while the client connection is open. Has no effect otherwise. The event can be accessed (e.g. to cancel it) via this component's .load_event attribute."}, 'show_label': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will display label.'}, 'info': {'type': 'str | None', 'default': 'None', 'description': None}, 'scale': {'type': 'int | None', 'default': 'None', 'description': 'relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.'}, 'min_width': {'type': 'int', 'default': '160', 'description': 'minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.'}, 'interactive': {'type': 'bool | None', 'default': 'None', 'description': 'if True, will be rendered as an editable textbox; if False, editing will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.'}, 'visible': {'type': 'bool', 'default': 'True', 'description': 'If False, component will be hidden.'}, 'rtl': {'type': 'bool', 'default': 'False', 'description': 'If True and `type` is "text", sets the direction of the text to right-to-left (cursor appears on the left of the text). Default is False, which renders cursor on the right.'}, 'elem_id': {'type': 'str | None', 'default': 'None', 'description': 'An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'elem_classes': {'type': 'list[str] | str | None', 'default': 'None', 'description': 'An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.'}, 'render': {'type': 'bool', 'default': 'True', 'description': 'If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.'}, 'min': {'type': 'float | None', 'default': 'None', 'description': None}, 'max': {'type': 'float | None', 'default': 'None', 'description': None}, 'step': {'type': 'float | None', 'default': 'None', 'description': None}}, 'postprocess': {'value': {'type': 'str | None', 'description': 'Expects a {str} returned from function and sets textarea value to it.'}}, 'preprocess': {'return': {'type': 'str | None', 'description': 'Passes text value as a {str} into the function.'}, 'value': None}}, 'events': {'change': {'type': None, 'default': None, 'description': 'Triggered when the value of the PromptWeighting changes either because of user input (e.g. a user types in a textbox) OR because of a function update (e.g. an image receives a value from the output of an event trigger). See `.input()` for a listener that is only triggered by user input.'}, 'input': {'type': None, 'default': None, 'description': 'This listener is triggered when the user changes the value of the PromptWeighting.'}, 'submit': {'type': None, 'default': None, 'description': 'This listener is triggered when the user presses the Enter key while the PromptWeighting is focused.'}}}, '__meta__': {'additional_interfaces': {}, 'user_fn_refs': {'PromptWeighting': []}}}
|
7 |
|
8 |
abs_path = os.path.join(os.path.dirname(__file__), "css.css")
|
9 |
|
|
|
21 |
# `gradio_promptweighting`
|
22 |
|
23 |
<div style="display: flex; gap: 7px;">
|
24 |
+
<a href="https://pypi.org/project/gradio_promptweighting/" target="_blank"><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/gradio_promptweighting"></a>
|
25 |
</div>
|
26 |
|
27 |
Simple component for creating prompt weighting for real-time generation.
|
|
|
53 |
with gr.Row():
|
54 |
with gr.Column():
|
55 |
prompt = PromptWeighting(
|
56 |
+
value=[
|
57 |
+
{"prompt": "a cat", "scale": 1.5},
|
58 |
+
{"prompt": "a dog", "scale": 1},
|
59 |
+
{"prompt": "a bird", "scale": 0.5},
|
60 |
+
],
|
61 |
+
step=0.001,
|
62 |
+
info="Please drag up or down to adjust the weight of the prompt.",
|
63 |
)
|
64 |
btn = gr.Button("Update Prompt")
|
65 |
with gr.Column():
|
src/pyproject.toml
CHANGED
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
|
|
8 |
|
9 |
[project]
|
10 |
name = "gradio_promptweighting"
|
11 |
-
version = "0.0.
|
12 |
description = "Simple component for creating prompt weighting for real-time generation."
|
13 |
readme = "README.md"
|
14 |
license = "MIT"
|
@@ -36,7 +36,7 @@ classifiers = [
|
|
36 |
dev = ["build", "twine"]
|
37 |
|
38 |
[tool.hatch.build]
|
39 |
-
artifacts = ["/backend/gradio_promptweighting/templates", "*.pyi", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates"]
|
40 |
|
41 |
[tool.hatch.build.targets.wheel]
|
42 |
packages = ["/backend/gradio_promptweighting"]
|
|
|
8 |
|
9 |
[project]
|
10 |
name = "gradio_promptweighting"
|
11 |
+
version = "0.0.2"
|
12 |
description = "Simple component for creating prompt weighting for real-time generation."
|
13 |
readme = "README.md"
|
14 |
license = "MIT"
|
|
|
36 |
dev = ["build", "twine"]
|
37 |
|
38 |
[tool.hatch.build]
|
39 |
+
artifacts = ["/backend/gradio_promptweighting/templates", "*.pyi", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates", "backend/gradio_promptweighting/templates"]
|
40 |
|
41 |
[tool.hatch.build.targets.wheel]
|
42 |
packages = ["/backend/gradio_promptweighting"]
|