From ea0698d55d19c9ea26fbacf982d2de539bb0c422 Mon Sep 17 00:00:00 2001
From: nodemode-ai
-
+
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
index 90dfe6ab..27caed59 100644
--- a/backend/app/__init__.py
+++ b/backend/app/__init__.py
@@ -21,4 +21,4 @@
except ImportError:
pass
-__version__ = "2.8.1"
+__version__ = "2.8.2"
diff --git a/demo/assets/demo.js b/demo/assets/demo.js
index 53b1e036..e0f3bed1 100644
--- a/demo/assets/demo.js
+++ b/demo/assets/demo.js
@@ -1,4 +1,4 @@
-(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=`2.8.1`,f=`This needs the desktop engine. The demo runs the picture engine in the page; saving to the library, camera raw, colour conversion, local models, video and agents belong to the desktop app.`,p=(e,t=200)=>new Response(JSON.stringify(e),{status:t,headers:{"Content-Type":`application/json`}}),m={name:`formvis`,version:d,desktop:!1,decode:{heic:!1,tiff:!0,engine:`page`},removeBackground:{ml:!1,lite:!1,default:null,model:``},dataDir:``},h={"/library":[],"/plugins":[],"/outputs":[],"/jobs":[],"/mcp/bridge/changed":{},"/mcp/bridge/stop":{}},g=e=>e===`/capabilities`?p(m):e in h?p(h[e]):p({detail:f},503),_=class extends EventTarget{url;static CONNECTING=0;static OPEN=1;static CLOSING=2;static CLOSED=3;readyState=0;binaryType=`blob`;onopen=null;onclose=null;onerror=null;onmessage=null;constructor(e){super(),this.url=e,window.setTimeout(()=>{this.readyState=3;let e=new Event(`close`);this.onclose?.(e),this.dispatchEvent(e)},0)}send(){}close(){this.readyState=3}},v=window.WebSocket;window.WebSocket=new Proxy(v,{construct(e,t){let n=String(t[0]);return/^wss?:\/\/(api\/|\/)/.test(n)||n.includes(`/api/`)?new _(n):new e(...t)}});var y=window.fetch.bind(window);window.fetch=(e,t)=>{let n=typeof e==`string`?e:e instanceof URL?e.href:e.url,r=n.indexOf(`/api/`);if(!(n.startsWith(`/api/`)||n.startsWith(`file:`)&&r>=0))return y(e,t);let i=n.slice(r+4).split(`?`)[0];return Promise.resolve(g(i))};function b(e){let t=document.createElement(`canvas`);return t.width=Math.max(1,e.naturalWidth),t.height=Math.max(1,e.naturalHeight),t.getContext(`2d`).drawImage(e,0,0),t}async function x(e){let t=new Image;return t.src=e,await t.decode(),b(t)}function S(e){let t=e.getContext(`2d`,{willReadFrequently:!0}),n=t.getImageData(0,0,e.width,e.height),r=n.data;for(let e=0;e
=0){let n=l*s,r=u*s;for(let i=0;i=0){let n=u*s;for(let r=0;r=.1))return new ImageData(new Uint8ClampedArray(e.data),n,r);let i=Xt(e.data),a=Qt(t).map(e=>(e-1)/2);if(!Oe(i,n,r,a)){let e=new Float32Array(i.length);for(let t of a)$t(i,e,n,r,t,!0),$t(e,i,n,r,t,!1)}return Zt(i,n,r)}function tn(e){return Math.ceil(3*e)+1}function nn(e,t,n,r,i,a){let o=Math.floor(r),s=Math.floor(i),c=r-o,l=i-s;for(let r=0;r<4;r++){let i=0;for(let a=0;a<2;a++){let u=s+a;if(u<0||u>=n)continue;let d=a?l:1-l;for(let n=0;n<2;n++){let a=o+n;a<0||a>=t||(i+=d*(n?c:1-c)*e[(u*t+a)*4+r])}}a[r]+=i}}function rn(e,t,n){let{width:r,height:i}=e,a=Xt(e.data),o=new Float32Array(a.length),s=t*Math.PI/180,c=Math.cos(s),l=-Math.sin(s),u=Math.max(2,Math.min(96,Math.ceil(n)+1)),d=Array.from({length:u},(e,t)=>-n/2+n*t/(u-1)),f=new Float64Array(4);for(let e=0;e=r&&(o[e+t]=Math.round(_t(o[e+t]+n*s,0,255)))}return a}function sn(e){return e=e+2654435769|0,e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^e>>>16)>>>0}function cn(e,t,n,r,i){let a=new ImageData(new Uint8ClampedArray(e.data),e.width,e.height),o=a.data,s=t/100*127.5;if(!n&&je(o,s,r,i))return a;for(let e=0,t=0;t=i))for(let e=-c;e<=c;e+=u){let i=t+e;if(i<0||i>=r||e*e+n*n>c*c)continue;let u=a[(s*r+i)*4+o],m=Math.abs(u-d);if(m>l)continue;let h=1-m/(l*2.5);f+=u*h,p+=h}}s[n+o]=p?Math.round(f/p):d}}return o}function En(e,t,n){let r=[0,t/8,t/4,t/2,t].filter((e,t,n)=>t===0||e>n[t-1]+.01),i=r.map(t=>t<.3?e:en(e,t)),{width:a,height:o}=e,s=xn(e),c=s.data;for(let e=0;e0&&i>=r?l:1;c[e*4]=ra[o[e*4]]*a*t,c[e*4+1]=ra[o[e*4+1]]*a*t,c[e*4+2]=ra[o[e*4+2]]*a*t,c[e*4+3]=t}let u=Wi(c,i,a,t),d=new ImageData(i,a),f=d.data;for(let e=0;e{let a=Math.min(t-1,Math.max(0,r)),o=Math.min(n-1,Math.max(0,i)),s=Math.floor(a),c=Math.floor(o),l=Math.min(t-1,s+1),u=Math.min(n-1,c+1),d=a-s,f=o-c;return(e[c*t+s]*(1-d)+e[c*t+l]*d)*(1-f)+(e[u*t+s]*(1-d)+e[u*t+l]*d)*f};for(let e=0;er?255:0}}return i}function No(e,t,n){let r=$n(e),i=Zn(n,e.width,e.height);if(!i)return r;let a=Math.max(1,Math.round(t)),o=e.data,s=r.data,c=e.width;for(let t=Math.floor((i.y0-n.y0)/a);n.y0+t*a0?0:1;e<=h;e++){let r=er(Math.floor(s),0,t-1),o=er(Math.floor(c),0,n-1)*t+r,f=Math.exp(-(e*e)/(2*Math.max(1,h*h*.25)));i[0]+=l[o*3]*f,i[1]+=l[o*3+1]*f,i[2]+=l[o*3+2]*f,i[3]+=g[o]*f,a+=f;let m=p[o*2],_=p[o*2+1];m*u+_*d<0&&(m=-m,_=-_),u=m,d=_,s+=u,c+=d}}let o=e*t+r;for(let e=0;e<4;e++)_[o*4+e]=i[e]/a}let v=new Float32Array(s);for(let e=0;e127&&(n[e+t]=255-n[e+t]);return t}function aee(e,t,n,r,i,a,o,s){let c=Zn(a,e.width,e.height),l=$n(e);if(!c)return l;let u=e.data,d=l.data,f=e.width,p=Math.max(1,Math.min(a.x1-a.x0,a.y1-a.y0)/Math.max(1,t)),m=p*n/100;for(let e=c.y0;e