PageSourceSearch

https://comfy.icu/_next/static/chunks/pages/workflows/[workflow_id]/edit-89e87a126b6b366b.js

js comfy.icu collected 2026-10-04 07:45:34 UTC 38,060 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[625],{79908:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(87104).Z)("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]])},40154:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(87104).Z)("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]])},42331:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(87104).Z)("ImagePlus",[["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"31hg93"}],["line",{x1:"16",x2:"22",y1:"5",y2:"5",key:"ez7e4s"}],["line",{x1:"19",x2:"19",y1:"2",y2:"8",key:"1gkr8c"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},8257:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(87104).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},90502:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(87104).Z)("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]])},78411:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});let i=(0,n(87104).Z)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},58460:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/workflows/[workflow_id]/edit",function(){return n(20732)}])},46164:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var i=n(651),a=n(93875),s=n(25109),r=n(30188),o=n(48704),l=n(23767),c=n(85359),d=n(11902),u=n(6203),h=n(51260),p=n(29440),m=n(23500);let f=e=>{let{workflow_id:t}=e,n=(0,a.useRouter)(),{toast:s}=(0,c.pm)(),{trigger:d,isLoading:u}=(0,r.u)(),h=async()=>{try{await d("/api/v1/workflows/".concat(t),{method:"DELETE"}),n.push("/"),s({title:"Success",description:"Workflow deleted successfully"})}catch(e){}};return(0,i.jsxs)("button",{disabled:u,title:"Delete workflow",onClick:e=>{e.preventDefault();let t=prompt('Warning: Proceeding will permanently delete this workflow and all related files. Type "DELETE" to confirm:');t&&"DELETE"===t.toUpperCase()?h():s({title:"Cancelled",description:"Deletion cancelled"})},className:"inline-flex items-center justify-center btn hover:bg-red-800",children:[u&&(0,i.jsx)(l.frZ,{className:"h-5 w-5 mr-1 animate-spin-slow"}),!u&&(0,i.jsx)(o.We9,{})]})};function g(e){let{workflow:t,isOpen:n,setIsOpen:a}=e,{toast:o}=(0,c.pm)(),{trigger:g,isLoading:w}=(0,r.u)(),y=(0,s.cI)({defaultValues:{name:"ComfyUI Workflow"===t.name?"":t.name,description:t.description,tags:t.tags.join(", "),is_nsfw:t.is_nsfw,visibility:t.visibility}}),v=y.handleSubmit(async e=>{try{await g("/api/v1/workflows/".concat(t.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o({title:"Success",description:"Workflow updated successfully"}),a(!1)}catch(e){}});return(0,i.jsx)(d.Vq,{open:n,onOpenChange:a,children:(0,i.jsxs)(d.cZ,{className:"max-w-2xl",children:[(0,i.jsxs)(d.fK,{children:[(0,i.jsx)(d.$N,{children:"Workflow Settings"}),(0,i.jsx)(d.Be,{children:"Edit your workflow details and visibility settings."})]}),(0,i.jsxs)("form",{onSubmit:v,className:"mt-4 space-y-4",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(p._,{htmlFor:"name",children:"Name"}),(0,i.jsx)(u.I,{id:"name",...y.register("name",{required:!0}),placeholder:"Workflow name"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(p._,{htmlFor:"description",children:"Description"}),(0,i.jsx)(h.g,{id:"description",...y.register("description"),placeholder:"Description in Markdown",rows:3})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(p._,{htmlFor:"tags",children:"Tags"}),(0,i.jsx)(u.I,{id:"tags",...y.register("tags"),placeholder:"Tags (comma separated)"})]}),(0,i.jsx)("div",{className:"space-y-4",children:(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)(p._,{htmlFor:"visibility",children:"Visibility"}),(0,i.jsxs)(m.Ph,{defaultValue:y.getValues("visibility"),onValueChange:e=>y.setValue("visibility",e),children:[(0,i.jsx)(m.i4,{children:(0,i.jsx)(m.ki,{placeholder:"Select visibility"})}),(0,i.jsxs)(m.Bw,{children:[(0,i.jsx)(m.Ql,{value:"PUBLIC",children:"Public"}),(0,i.jsx)(m.Ql,{value:"HIDE_PROMPT",children:"Public but hide the prompt"}),(0,i.jsx)(m.Ql,{value:"PRIVATE",children:"Private"})]})]})]})}),(0,i.jsxs)("div",{className:"flex justify-between pt-4",children:[(0,i.jsx)(f,{workflow_id:t.id}),(0,i.jsxs)("button",{disabled:w,type:"submit",className:"inline-flex items-center justify-center btn",children:[w&&(0,i.jsx)(l.frZ,{className:"h-5 w-5 mr-1 animate-spin-slow"}),"Save Changes"]})]})]})]})})}g.displayName="EditWorkflow"},42447:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var i=n(651),a=n(18256),s=n(12446);function r(e){let{workflow_id:t,take:n,view:r}=e,{data:o,error:l}=(0,s.ZP)(t?"/api/v1/workflows/".concat(t,"/runs"):"/api/v1/runs?take=".concat(n||300));return(0,i.jsxs)("div",{className:"relative w-full",children:[(0,i.jsx)("div",{className:"block absolute bg-zinc-800 w-0.5 h-full"}),(0,i.jsx)(a.Z,{view:r,data:o}),l&&(0,i.jsx)("div",{className:"w-full text-center my-6 px-6 text-red-500",children:"Failed to load runs. Please try again later."})]})}r.displayName="WorkflowHistory"},51260:function(e,t,n){"use strict";n.d(t,{g:function(){return r}});var i=n(651),a=n(92379),s=n(71663);let r=a.forwardRef((e,t)=>
1{let{className:n,...a}=e;return(0,i.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",n),ref:t,...a})});r.displayName="Textarea"},30188:function(e,t,n){"use strict";n.d(t,{u:function(){return o}});var i=n(92379),a=n(46969),s=n(53958),r=n(85359);function o(e){let[t,n]=(0,i.useState)({isLoading:!1}),o=null==e?void 0:e.errorTitle;return{trigger:(0,i.useCallback)(async(e,t)=>{n(e=>({...e,isLoading:!0,error:void 0}));try{let i=await (0,a.S)(e,t);return n({data:i,error:void 0,isLoading:!1}),i}catch(e){throw(0,r.Am)({title:null!=o?o:"Error",description:(0,s.N3)(e),variant:"destructive"}),n(t=>({...t,error:e,isLoading:!1})),e}},[o]),data:t.data,error:t.error,isLoading:t.isLoading}}},53958:function(e,t,n){"use strict";function i(e){return e instanceof Error?e.message:String(e)}n.d(t,{N3:function(){return i}})},20732:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return O},default:function(){return P}});var i=n(651),a=n(63795),s=n.n(a),r=n(53958),o=n(46969),l=n(18101),c=n.n(l),d=n(92379),u=n(27969),h=n(13937),p=n(21160),m=n(23767),f=n(48704),g=n(46164);let w=["Digital drawing portrait of a wolf illustrated in hyper-detailed neon cyberpunk style, close-up framing, with a bold twist: the wolf is composed entirely of holographic light projections. Its form flickers and refracts, with layered neon outlines in magenta, cyan, and electric blue creating a translucent, glitching silhouette with chromatic aberration. Facial features are sharp but fragmented, as if rendered by a malfunctioning AI display. Fur is replaced with animated light textures. The eyes glow intensely, projecting thin beams of light forward, suggesting awareness and surveillance. Lighting is high-contrast and synthetic, with strong glow effects, bloom, and chromatic aberration. Backgroun
1d is a dark futuristic void with floating grids, broken pixels, and digital noise. The mood is intense, otherworldly, and slightly unsettling, blending animal instinct with digital consciousness. Style leans toward futuristic concept art and synthwave aesthetics, ultra-sharp details, high saturation, cinematic cyberpunk illustration.","A digital artwork depicting a powerful, ethereal female warrior with an otherworldly presence. She stands in the center of the image, bathed in a soft, radiant light that highlights her divine aura. The background is a deep, dark blue, suggesting a celestial or heavenly setting, with faint, sparkling stars scattered throughout, enhancing the mystical atmosphere. The warrior is adorned in elaborate, golden armor that gleams with an almost divine light. Her armor includes a chest plate, shoulder guards, and gauntlets, all intricately designed with ornate details. She also wears a flowing, white, tunic-like garment that billows dramatically, giving the impression of movement even though she stands still. The fabric appears almost weightless, with delicate, wispy textures that contrast with the solidity of her golden armor. Her hair is long, flowing, and white, blending seamlessly with the fabric of her garment. She has large, majestic wings that are also white with hints of gold, adding to her angelic appearance. In her right hand, she wields a long, ornate spear, its tip gleaming with a golden hue. The overall composition exudes strength, elegance, and a sense of celestial majesty.","A raw 35mm film still of a stunning ginger woman with vivid forest-green eyes and a dense galaxy of freckles cascading across her nose and deep into her busty cleavage. Golden hour sunlight streams through a dusty window, creating sharp specular highlights on her collarbones and a warm volumetric haze. Extreme dermatological realism: visible skin pores, fine vellus hair (peach fuzz) along the jawline, a subtle summer sweat sheen, and the fine texture of goosebumps on her shoulders. Her copper hair is a wild, unbrushed mane of individual strands and flyaways, backlit to create a fiery, translucent halo. Her eyes show intricate iris trabeculae, dark limbal rings, and a glossy tear film reflecting the room’s architecture. Analog imperfections: heavy silver halide film grain, a subtle amber light leak in the bottom corner, and soft lens flare. The f/1.2 aperture creates a creamy bokeh background of an old wooden attic, with dancing dust motes caught in the light beams. The aesthetic is unpolished and intimate, capturing every organic flaw from the faint blue veins beneath her translucent skin to the natural lip cracks and messy mascara smudges. Wide-angle lens distortion slightly curves the frame, adding to the candid, voyeuristic atmosphere","A digital painting in a realistic style with exquisite detail, depicting a female warrior dressed in black ninja attire, with an old asain womens face. Her entire figure is shrouded in deep black; she wears a tightly wrapped headcloth and mask, revealing only a pair of sharp, expressive eyes that convey cold determination and intense focus. Her upper body is clad in a black, bandeau-style armour adorned with golden embroidered patterns, accentuating her athletic and sensual curves, with a flat and toned abdomen. A wide black sash is tied at her waist, falling naturally into flowing, draped skirts. The fabric appears light and fluid, as though it moves with her steps or a passing breeze. A slit on the left thigh adds a sense of motion and danger. arms are covered with intricately decorated black bracers, also accented with bronze-toned metal motifs. In one of her hands she grips a katana, its hilt dark in colour, the blade angled downward with an imposing presence. her other hand is empty She wears tall black combat boots, their surfaces detailed with fine stitching and metal studs. The overall design blends traditional ninja elements with modern fantasy aesthetics. She is standing on the rooftop ridge line tiles ontop of an old Japanese rooftop temple building high in the air,above the trees and building below, in the middle of the night only lit by the moon obscured behind some clouds.","midnight on a rainy downtown rooftop, 24-year-old stunning brunette with long wavy hair blowing in the wind, standing with legs apart and hands in pockets, tight white sports bra pushing up perfect cleavage, black hot pants, oversized olive-green bomber jacket hanging completely open, black combat boots, subtle gold body chain around waist catching neon reflections, wet skin from rain, hard cyan and magenta city neon rim-lighting from below + warm orange streetlight from side, cinematic teal color grading, high contrast, water droplets on 
1skin and leather, background endless cyber-city skyline with light trails, low-angle hero shot from ground level looking up, pure badass cool-girl energy, shot on Sony A1 35 mm 1.4 wide open, 8k raw --ar 3:4 --stylize 900 --v 6 --brunette rooftop night --black micro hotpants white sports bra open green bomber jacket --neon rain --low angle","sun-drenched 1950s American small-town gas station at golden hour, 24-year-old stunning brunette rockabilly pinup sitting casually on the hood of a flame-painted cherry-red 1955 Chevrolet Bel Air, legs slightly spread and one high-heel foot playfully resting on the bumper, perfect hourglass figure, wearing super tight high-waist faded blue denim jeans rolled up at the cuffs showing her ankles, tiny red cherry polka-dot halter top barely containing her massive chest, open black leather jacket with white fur collar, classic red bandana tied in hair, big victory-roll bangs, perfect winged eyeliner and bright cherry-red lips, tiny heart tattoo on collarbone, chrome and whitewall tires gleaming, background vintage Gulf gas pumps, faded Coca-Cola sign, dusty road and endless desert highway, hard golden side light + cool teal shadows, ultra-rich 1950s Technicolor grading with punchy reds and teals, high contrast, lens flare from sun, shot on 35 mm Panavision anamorphic 50 mm, shallow depth of field, pure Grease meets Sin City pinup energy, hyper-realistic skin, leather, denim and chrome reflections, 8k film scan look --ar 3:4 --stylize 900 --v 6 --rockabilly brunette --1955 chevy bel air --50s gas station --golden hour --technicolor red teal grading --pinup on hood --polka dot halter top --high waist rolled jeans --victory rolls --cherry red lips"];function y(){var e;return{id:"aecc9ce4-a576-4c54-a10b-f2ed3c1f2894",revision:0,last_node_id:27,last_link_id:51,nodes:[{id:8,type:"VAEDecode",pos:[1209,188],size:[210,46],flags:{},order:8,mode:0,inputs:[{name:"samples",type:"LATENT",link:51},{name:"vae",type:"VAE",link:45}],outputs:[{name:"IMAGE",type:"IMAGE",slot_index:0,links:[16]}],properties:{"Node name for S&R":"VAEDecode",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:[]},{id:9,type:"SaveImage",pos:[1454.93896484375,190.9700164794922],size:[976.0567626953125,1060.976684570312],flags:{},order:9,mode:0,inputs:[{name:"images",type:"IMAGE",link:16}],outputs:[],properties:{"Node name for S&R":"SaveImage",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:["ComfyUI"]},{id:13,type:"EmptySD3LatentImage",pos:[530,620],size:[315,106],flags:{},order:0,mode:0,inputs:[],outputs:[{name:"LATENT",type:"LATENT",slot_index:0,links:[17]}],properties:{"Node name for S&R":"EmptySD3LatentImage",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:[1024,1024,1]},{id:7,type:"CLIPTextEncode",pos:[420,400],size:[425.2780151367188,180.6060791015625],flags:{},order:5,mode:0,inputs:[{name:"clip",type:"CLIP",link:44}],outputs:[{name:"CONDITIONING",type:"CONDITIONING",slot_index:0,links:[6]}],title:"CLIP Text Encode (Negative Prompt)",properties:{"Node name for S&R":"CLIPTextEncode",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:["blurry ugly bad"],color:"#322",bgcolor:"#533"},{id:18,type:"CLIPLoader",pos:[80,460],size:[270,106],flags:{},order:1,mode:0,inputs:[],outputs:[{name:"CLIP",type:"CLIP",links:[43,44]}],properties:{"Node name for S&R":"CLIPLoader",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:["qwen_3_4b.safetensors","lumina2","default"]},{id:16,type:"UNETLoader",pos:[80,60],size:[270,82],flags:{},order:2,mode:0,inputs:[],outputs:[{name:"MODEL",type:"MODEL",links:[42]}],properties:{"Node name for S&R":"UNETLoader",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:["z_image_turbo_bf16.safetensors","default"]},{id:11,type:"ModelSamplingAuraFlow",pos:[390,60],size:[315,58],flags:{},order:6,mode:4,inputs:[{name:"model",type:"MODEL",link:42}],outputs:[{name:"MODEL",type:"MODEL",slot_index:0,links:[47]}],properties:{"Node name for S&R":"ModelSamplingAuraFlow",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:[3]},{id:3,type:"KSampler",pos:[863,186],size:[315,262],flags:{},order:7,mode:0,inputs:[{name:"model",type:"MODEL",link:47},{name:"positive",type:"CONDITIONING",link:4},{name:"negative",type:"CONDITIONING",link:6},{name:"latent_image",type:"LATENT",link:17}],outputs:[{name:"LATENT",type:"LATENT",slot_index:0,links:[51]}],properties:{"Node name for S&R":"KSampler",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:[Math.floor(0x4000000000000*Math.random()),"randomize",9,1,"euler","simple",1]},{id:6,type:"CLIPTextEncode",pos:[420,190],size:[423.8300170898438,177.1177062988281],flags:{},order:4,mode:0,inputs:[{name:"clip",type:"CLIP",link:43}],outputs:[{name:"CONDITIONING",type:"CONDITIONING",slot_index:0,links:[4]}],title:"CLIP Text Encode (Positive Prompt)",properties:{"Node name for S&R":"CLIPTextEncode",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:[(e=Math.floor(Math.random()*w.length),w[e])],color:"#232",bgcolor:"#353"},{id:17,type:"VAELoader",pos:[71.2282485961914,614.4132080078125],size:[270,58],flags:{},order:3,mode:0,inputs:[],outputs:[{name:"VAE",type:"VAE",links:[45]}],properties:{"Node name for S&R":"VAELoader",ue_properties:{widget_ue_connectable:{},version:"7.5.2",input_ue_unconnectable:{}}},widgets_values:["flux1-ae.safetensors"]}],links:[[4,6,0,3,1,"CONDITIONING"],[6,7,0,3,2,"CONDITIONING"],[16,8,0,9,0,"IMAGE"],[17,13,0,3,3,"LATENT"],[42,16,0,11,0,"MODEL"],[43,18,0,6,0,"CLIP"],[44,18,0,7,0,"CLIP"],[45,17,0,8,1,"VAE"],[47,11,0,3,0,"MODEL"],[51,3,0,8,0,"LATENT"]],groups:[],config:{},extra:{ds:{scale:.8769226950000005,offset:[-3.2636515972038342,33.23042241494999]},ue_links:[],VHS_MetadataImage:!0,VHS_latentpreview:!1,VHS_KeepIntermediate:!0,VHS_latentpreviewrate:0,workflowRendererVersion:"LG"},version:.4}}var v=n(98298),x=n(75131),b=n(79149),k=n(85359),j=n(52990),_=n(70845),N=n(11902),T=n(45716),I=n(9416),C=n(42447),E=n(19304);function S(e){let{workflow:t,isOpen:n,setIsOpen:a,uploadCallback:s,initialTab:r="history"}=e,[o,l]=(0,d.useState)(null),[,u]=(0,d.useState)(null),[h,p]=(0,d.useState)(!1),[f,g]=(0,d.useState)(r),[w,y]=(0,d.useState)(null);async function v(){p(!0);let e=await fetch("/api/v1/workflows/"+t.id+"/runs?take=10");u(await e.json()),p(!1)}async function x(e,t){p(!0);let n=await fetch("/api/v1/workflows/"+t+"/files");if(n.ok)y(null);else{y("Sorry something went wrong, please try again."),p(!1);return}l(await n.json()),p(!1)}let b=e=>{g(e),"history"===e||"output"===e?(l(null),v()):(u(null),x(e,t.id))};return(0,d.useEffect)(()=>{n&&b(r)},[n,r]),(0,i.jsx)(N.Vq,{open:n,onOpenChange:a,children:(0,i.jsx)(N.cZ,{className:"max-w-7xl",children:(0,i.jsxs)("div",{className:"flex justify-between",children:[(0,i.jsxs)(E.mQ,{value:f,onValueChange:b,className:"w-full",children:[(0,i.jsxs)(E.dr,{children:[(0,i.jsx)(E.SP,{value:"history",children:"History"}),(0,i.jsx)(E.SP,{value:"output",children:"Outputs"}),(0,i.jsx)(E.SP,{value:"input",children:"Inputs"})]}),(0,i.jsx)(E.nU,{value:"input",children:(0,i.jsx)("div",{className:"overflow-y-auto h-[calc(100vh-200px)]",children:(0,i.jsx)(I.Pp,{assets:null!=o?o:[],selection_mode:"none",library_label:"Workflow inputs",library_collapsible:!1,empty_message:"No input assets yet.",on_uploaded:async()=>{await x("input",t.id),s()}})})}),(0,i.jsx)(E.nU,{value:"history",children:(0,i.jsxs)("div",{className:"overflow-y-auto h-[calc(100vh-200px)]",children:[(0,i.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,i.jsx)("h2",{className:"text-2xl",children:"Run History"}),(0,i.jsx)(c(),{href:"/workflows/"+t.id+"/runs",target:"_blank",className:"cursor-pointer inline-flex justify-center btn",children:"View all"})]}),(0,i.jsx)(C.Z,{workflow_id:t.id,take:10,view:"list"})]})}),(0,i.jsx)(E.nU,{value:"output",children:(0,i.jsxs)("div",{className:"overflow-y-auto h-[calc(100vh-200px)]",children:[(0,i.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,i.jsx)("h2",{className:"text-2xl",children:"Run Outputs"}),(0,i.jsx)(c(),{href:"/workflows/"+t.id+"/runs",target:"_blank",className:"cursor-pointer inline-flex justify-center btn",children:"View all"})]}),(0,i.jsx)(C.Z,{workflow_id:t.id,take:10,view:"gallery"})]})})]}),h&&(0,i.jsx)("div",{children:(0,i.jsx)(m.frZ,{className:"h-8 w-8 mx-auto text-gray-200 animate-spin"})}),w&&(0,i.jsx)("div",{className:"text-red-500 mt-3 text-center",children:w})]})})})}function L(e,t){var n="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",t+".json"),document.body.appendChild(i),i.click(),i.remove()}let A=(0,d.forwardRef)((e,t)=>{let{workflow:n,iframeUrl:a,accelerator:s,onQueued:o,track:l}=e,c=(0,d.useRef)(null),[u,h]=(0,d.useState)(null),[p,f]=(0,d.useState)(!0),g=(0,d.useRef)(null);async function w(e){let{output:t,workflow:i,accelerator:a}=e,s={workflowId:n.id,prompt:t,extra_data:{extra_pnginfo:{workflow:i}},accelerator:a};try{let e=await fetch("/api/v1/workflows/"+n.id+"/runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!e.ok){let t=await e.json();throw Error(t.message||"Failed to queue workflow")}let t=await e.json().catch(()=>null);null==o||o(t),(0,k.Am)({title:"Queued",description:"Workflow is queued and will start soon"})}catch(e){(0,k.Am)({title:"Error Queuing Workflow",description:(0,r.N3)(e)||"Failed to queue workflow",variant:"destructive"})}}async function v(e,t){console.log("UPLOAD",typeof t.file);let n=t.file,i="clipspace"===t.subfolder?"clipspace/"+n.name:n.name;try{let e=await fetch("/api/v1/assets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:i,type:n.type,size:n.size})});if(!e.ok)return console.log("asset register failed"),x("upload_rejected",{name:n.name});let{url:a,public_url:s}=await e.json();if(!(await fetch(a,{method:"PUT",mode:"cors",body:n,headers:{"Content-Type":n.type}})).ok)return console.log("asset PUT failed"),x("upload_rejected",{name:n.name});return x("upload_done",{image:s,name:n.name,subfolder:"clipspace"===t.subfolder?t.subfolder:"",type:"input",src:s})}catch(e){return console.log("upload error",e),x("upload_rejected",{name:n.name})}}function x(e,t){var n,i;console.log("[Parent] send",e,t),null===(i=c.current)||void 0===i||null===(n=i.contentWindow)||void 0===n||n.postMessage({internal:{type:e,data:t}},"*")}let j=()=>{x("get_prompt",{})};async function _(){x("refresh_defs",{})}async function N(){x("refresh_defs",{})}async function T(e){let t=JSON.stringify(e.workflow);t!==g.current&&(await fetch("/api/v1/workflows/"+n.id+"/runs/"+n.current_run_id,{headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({workflow:e.workflow}),method:"PUT"})).ok&&(g.current=t)}let I=(0,b.E)(e=>e.openAlert);async function C(){console.log("load_prompt");try{var e,t,i;let a=await fetch("/api/v1/workflows/"+n.id+"/runs/"+n.current_run_id);if(!a.ok){let e=await a.json();throw Error(e.message||"Failed to fetch prompt")}let s=await a.json();console.log("[Parent] load_prompt",s);let r={prompt:null!==(e=s.prompt)&&void 0!==e?e:null,prompt_full:null!==(t=s.prompt_full)&&void 0!==t?t:null,files:null!==(i=s.files)&&void 0!==i?i:null};r.prompt_full?x("load_prompt",{id:n.id,prompt:r.prompt_full}):r.prompt?x("load_api_prompt",{id:n.id,prompt:r.prompt}):x("load_prompt",{id:n.id,prompt:y()})}catch(e){(0,k.Am)({title:"Failed to fetch prompt",description:(0,r.N3)(e)||"Failed to fetch prompt",variant:"destructive"})}}async function E(){I({title:"Clearing Nodes",description:"Are you sure you want to remove all nodes?",cancelText:"Cancel",actionText:"Clear",onAction:()=>{x("clear",{})}})}async function S(){I({title:"Load Default Workflow",description:"This will remove all existing nodes, are you sure?",cancelText:"Cancel",actionText:"Confirm",onAction:()=>{x("load_prompt",{id:n.id,prompt:y()})}})}async function A(){let e=document.createElement("input");e.type="file",e.accept=".json,image/png,image/webp",e.onchange=e=>{var t;let i=null===(t=e.target.files)||void 0===t?void 0:t[0];i&&x("import",{id:n.id,file:i})},e.click()}async function O(){x("logs",{})}async function P(){x("export",{id:n.id})}async function z(){x("export_api",{id:n.id})}let D=(0,d.useRef)(Date.now()),R=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{let e=async e=>{var t;if(null!=(t=e.data)&&t.internal){let{type:t,data:i}=e.data.internal;
1if(console.log("[Parent] received",t,i),"got_prompt"===t)w({...i,accelerator:s});else if("upload"===t)v(n.id,i);else if("loaded"===t)R.current||(R.current=!0,l("EDITOR_READY",{load_ms:Date.now()-D.current})),C();else if("prompt_loaded"===t)f(!1);else if("sync_workflow"===t)T(i);else if("missing_nodes"===t)l("EDITOR_MISSING_NODES",{nodes:(null!=i?i:[]).slice(0,25),count:(null!=i?i:[]).length}),I({title:"Missing Custom Nodes",description:"Following nodes are missing:\n\n"+i.join(", \n"),cancelText:null,actionText:"OK",onAction:()=>{}});else if("download_prompt"===t)L(i,"workflow-"+n.id);else if("download_api_prompt"===t)L(i,"workflow-api-"+n.id);else if("fetch_request"===t)try{let e=await fetch("/api/v1/workflows/"+n.id+"/"+i.url,i.options),t=await e.json();console.log("[Parent] Fetch Response",t),x("fetch_response",{requestId:i.requestId,data:t})}catch(e){x("fetch_response",{requestId:i.requestId,error:(0,r.N3)(e)})}}};function t(){console.log("adjustIframeHeight");let e=document.getElementById("editor-container");e&&(e.height="".concat(window.innerHeight-83,"px"))}t(),window.addEventListener("resize",t),window.addEventListener("message",e,!1),D.current=Date.now();let i=setTimeout(()=>{R.current||l("EDITOR_LOAD_FAILED",{waited_ms:3e4})},3e4);return h(a),()=>{window.removeEventListener("message",e),window.removeEventListener("resize",t),clearTimeout(i)}},[s]),(0,d.useImperativeHandle)(t,()=>({clearPrompt:E,defaultPrompt:S,runPrompt:j,importPrompt:A,exportPrompt:P,loadObjectInfo:_,exportApiPrompt:z,logs:O,refreshNodeDefs:N})),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex h-screen justify-center items-center",style:{display:p?"":"none",height:"calc(100vh - 83px)"},children:[(0,i.jsx)(m.frZ,{className:"h-6 w-6 animate-spin mr-4"}),(0,i.jsx)("span",{className:"text-zinc-500",children:"This might take a while, please wait."})]}),(0,i.jsxs)("div",{id:"editor-container",style:{visibility:p?"hidden":"visible"},children:[(0,i.jsx)("div",{}),(0,i.jsx)("div",{className:"flex-1 overflow-auto",style:{height:"100%"},children:(0,i.jsx)("iframe",{src:null!=u?u:void 0,id:"editor-iframe",ref:c,frameBorder:"0",width:"100%",height:"100%",style:{position:"relative",height:"calc(100vh - 83px)"}})})]})]})});A.displayName="ComfyUI";var O=!0;function P(e){var t,n,a,l;let{workflow:m,iframeUrl:w}=e,y=(0,b.E)(e=>e.openAlert),{status:I}=(0,h.useSession)(),C=(0,u.useRouter)(),[E,L]=(0,d.useState)(!1),[O,P]=(0,d.useState)(!1),{track:z}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,d.useRef)([]),n=(0,d.useRef)(null),i=(0,d.useRef)(e);i.current=e;let a=(0,d.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];n.current&&(clearTimeout(n.current),n.current=null);let i=t.current;if(0===i.length)return;t.current=[];let a=JSON.stringify({events:i});e&&"undefined"!=typeof navigator&&navigator.sendBeacon&&navigator.sendBeacon("/api/v1/events",new Blob([a],{type:"application/json"}))||fetch("/api/v1/events",{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}).catch(()=>{})},[]),s=(0,d.useCallback)(function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.current.push({name:e,properties:{...i.current,...s}}),t.current.length>=20){a();return}n.current||(n.current=setTimeout(()=>a(),5e3))},[a]);return(0,d.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState&&a(!0)},t=()=>a(!0);return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",t),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("pagehide",t),a(!0)}},[a]),{track:s,flush:a}}({workflow_id:null==m?void 0:m.id}),[D]=(0,d.useState)("output"),[R,M]=(0,d.useState)(C.query.workflow_id),V=(0,d.useRef)(null),[U,Z]=(0,d.useState)(null),[F,H]=(0,d.useState)(m.accelerator?m.accelerator:"L4"),W=(0,d.useRef)(null),q=(0,d.useRef)(null),[G,B]=(0,d.useState)(!1),[J,X]=(0,d.useState)("history");async function Q(e){H(e);try{await (0,o.S)("/api/v1/workflows/"+m.id,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({accelerator:e})})}catch(e){H(F),(0,k.Am)({title:"Error",description:(0,r.N3)(e),variant:"destructive"})}}let K=["INIT","QUEUED","STARTED","RUNNING"],$=e=>Array.isArray(e)&&e.some(e=>K.includes(null==e?void 0:e.status));function Y(){q.current&&(clearTimeout(q.current),q.current=null),W.current&&(W.current.close(),W.current=null)}function ee(){if(W.current||!R)return;let e=new EventSource("/api/v1/workflows/"+R+"/events");W.current=e,e.onmessage=e=>{try{var t;let n=JSON.parse(e.data);Z(n),t=n.tasks,q.current&&(clearTimeout(q.current),q.current=null),$(t)||(q.current=setTimeout(Y,3e4))}catch(e){}},e.addEventListener("bye",()=>Y())}async function et(){let e=await fetch("/api/cloud/status?workflow_id="+R);if(!e.ok)return null;let t=await e.json();return Z(t),t}function en(e){z("EDITOR_ACTION",{action:"".concat(e,"_tab")}),L(!0),X(e)}
1async function ei(e,t,n){e.stopPropagation();let i=e.currentTarget;i.disabled=!0;try{await fetch("/api/v1/workflows/"+t+"/runs/"+n+"/cancel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:n,status:"CANCELED"})})}catch(e){i.disabled=!1}}return(0,d.useEffect)(()=>{"authenticated"===I&&void 0!==C.query.workflow_id&&M(C.query.workflow_id)},[I,C,D]),(0,d.useEffect)(()=>{if(void 0===C.query.workflow_id)return;let e=!1;return(async()=>{let t=await et();!e&&t&&$(t.tasks)&&ee()})(),()=>{e=!0,Y()}},[R]),(0,i.jsxs)(j.Z,{collapsedSidebar:!0,hideFooter:!0,children:[(0,i.jsxs)(s(),{children:[(0,i.jsxs)("title",{children:[m.name," - Serverless ComfyUI"]}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),(0,i.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,i.jsx)("meta",{name:"twitter:title",content:"ComfyICU"}),(0,i.jsx)("meta",{name:"twitter:description",content:"Imgur for sharing ComfyUI workflows"}),(0,i.jsx)("meta",{name:"twitter:image",content:"https://r2.comfy.icu/oedBJX5D.png"}),(0,i.jsx)("meta",{property:"og:title",content:"ComfyICU"}),(0,i.jsx)("meta",{property:"og:description",content:"Imgur for sharing ComfyUI workflows"}),(0,i.jsx)("meta",{property:"og:image",content:"https://r2.comfy.icu/oedBJX5D.png"})]}),(0,i.jsx)(g.Z,{workflow:m,isOpen:G,setIsOpen:B}),(0,i.jsxs)("div",{className:"flex h-14 items-center border-b bg-background px-4",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 mr-2",children:[m.name,m.is_nsfw&&(0,i.jsx)("span",{className:"text-xs bg-red-500/50 text-red-100 px-1.5 py-1 rounded",children:"NSFW"})]}),(0,i.jsxs)(T.h_,{modal:!1,children:[(0,i.jsx)(T.$F,{asChild:!0,children:(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",children:[(0,i.jsx)(f.a1l,{className:"h-4 w-4"}),(0,i.jsx)("span",{className:"hidden sm:inline",children:"Workflow"}),(0,i.jsx)(f.bTu,{className:"h-3.5 w-3.5 opacity-60"})]})}),(0,i.jsxs)(T.AW,{align:"start",className:"min-w-[180px]",children:[(0,i.jsxs)(T.Xi,{onClick:e=>{var t;return null===(t=V.current)||void 0===t?void 0:t.importPrompt(e)},children:[(0,i.jsx)(f.tHe,{className:"mr-2 h-4 w-4"}),(0,i.jsx)("span",{children:"Open"})]}),(0,i.jsxs)(T.Xi,{onClick:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.exportPrompt()},children:[(0,i.jsx)(f.mW3,{className:"mr-2 h-4 w-4"}),(0,i.jsx)("span",{children:"Save"})]}),(0,i.jsxs)(T.Xi,{onClick:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.exportApiPrompt()},children:[(0,i.jsx)(f.mW3,{className:"mr-2 h-4 w-4"}),(0,i.jsx)("span",{children:"Save API"})]}),(0,i.jsxs)(T.Xi,{onClick:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.defaultPrompt()},children:[(0,i.jsx)(f.Bw1,{className:"mr-2 h-4 w-4"}),(0,i.jsx)("span",{children:"Reset"})]}),(0,i.jsxs)(T.Xi,{onClick:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.clearPrompt()},children:[(0,i.jsx)(f.q5L,{className:"mr-2 h-4 w-4"}),(0,i.jsx)("span",{children:"Clear"})]}),(0,i.jsxs)(T.Xi,{onClick:()=>B(!0),children:[(0,i.jsx)(f.nbt,{className:"mr-2 h-4 w-4"}),(0,i.jsx)("span",{children:"Settings"})]})]})]}),(0,i.jsx)("div",{className:"flex items-center mr-auto",children:(0,i.jsxs)("div",{className:"flex items-center gap-1 overflow-x-auto hide-scrollbar",children:[(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Run History",onClick:e=>en("history"),children:[(0,i.jsx)(f.TCC,{className:"h-4 w-4"}),"History"]}),(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Workflow Outputs",onClick:e=>en("output"),children:[(0,i.jsx)(f.xqh,{className:"h-4 w-4"}),"Outputs"]}),(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Workflow Inputs",onClick:e=>en("input"),children:[(0,i.jsx)(f._fJ,{className:"h-4 w-4"}),"Inputs"]}),U&&(0,i.jsxs)(i.Fragment,{children:[(null===(t=U.features)||void 0===t?void 0:t.custom_models)&&(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Models",onClick:()=>P(!0),children:[(0,i.jsx)(f.zFh,{className:"h-4 w-4"})," Models"]}),!(null===(n=U.features)||void 0===n?void 0:n.custom_models)&&(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Models",onClick:()=>y({title:"Custom models are a paid feature",description:"Upgrade to a paid plan to add your own models (CivArchive, Hugging Face, or any URL) to this project.",cancelText:"Not now",actionText:"View plans",onAction:()=>window.open("/pricing")}),children:[(0,i.jsx)(f.zFh,{className:"h-4 w-4"})," Models"]}),(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Logs",onClick:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.logs()},children:[(0,i.jsx)(f.cDN,{className:"h-4 w-4"}),"Logs"]}),(0,i.jsxs)("select",{value:F,onChange:e=>Q(e.target.value),className:"ml-4 bg-zinc-800 px-2 py-1.5 rounded outline-none",children:[(0,i.jsx)("option",{value:"L4",children:"L4 (24GB)"}),(0,i.jsx)("option",{value:"L40S",children:"L40S (48GB)"}),(0,i.jsx)("option",{value:"H100",children:"H100 (80GB)"})]}),(0,i.jsxs)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1 bg-sky-500 hover:bg-sky-500/50  transition-all active:scale-95",title:"Run",onClick:()=>{var e;ee(),null===(e=V.current)||void 0===e||e.runPrompt()},children:[(0,i.jsx)(f.KCr,{className:"mr-2"})," Run"]}),(0,i.jsx)(_.z,{variant:"ghost",size:"sm",className:"flex items-center gap-1",title:"Credits",asChild:!0,children:(0,i.jsxs)(c(),{href:"/account",target:"_blank",children:[(0,i.jsx)(f.Wqx,{className:"mr-2"}),(null!==(l=null===(a=U.credits)||void 0===a?void 0:a.balance)&&void 0!==l?l:0).toLocaleStr
1ing("en-US")]})}),U.tasks&&(0,i.jsx)("ul",{className:"inline-flex ml-4 text-white/50 ",children:U.tasks.map((e,t)=>(0,i.jsx)("li",{className:"mr-1",children:(0,i.jsx)(p.t,{status:e.status,run_time:e.run_time,showRunTime:!0,href:"/workflows/"+e.workflow_id+"/runs/"+e.id,linkTarget:"_blank",onOpen:()=>en("history"),onCancel:t=>ei(t,e.workflow_id,e.id)})},t))})]})]})})]}),R&&null!=R&&(0,i.jsx)(A,{workflow:m,iframeUrl:w,accelerator:F,onQueued:function(e){e&&e.id&&Z(t=>{var n,i;let a=null!=t?t:{},s=Array.isArray(a.tasks)?a.tasks:[];if(s.some(t=>t.id===e.id))return a;let r={id:e.id,status:null!==(n=e.status)&&void 0!==n?n:"INIT",workflow_id:null!==(i=e.workflow_id)&&void 0!==i?i:R,run_time:null,device:null,updated_at:Date.now()};return{...a,tasks:[r,...s].slice(0,5)}}),ee()},track:z,ref:V}),(0,i.jsx)(S,{workflow:m,isOpen:E,setIsOpen:L,uploadCallback:()=>{var e;null===(e=V.current)||void 0===e||e.loadObjectInfo()},initialTab:J}),(0,i.jsx)(N.Vq,{open:O,onOpenChange:P,children:(0,i.jsxs)(N.cZ,{className:"max-h-[90vh] max-w-6xl overflow-y-auto",children:[(0,i.jsxs)(N.fK,{children:[(0,i.jsx)(N.$N,{children:"Project models"}),(0,i.jsx)(N.Be,{children:"Browse and manage the models available to every workflow in this project."})]}),(0,i.jsx)(x.Z,{canWrite:!0,onChange:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.refreshNodeDefs()}}),(0,i.jsxs)(N.cN,{className:"gap-2",children:[(0,i.jsx)(_.z,{variant:"outline",asChild:!0,children:(0,i.jsx)(c(),{href:"/models/library",children:"Open model library"})}),(0,i.jsx)(v.Z,{onAdded:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.refreshNodeDefs()},children:(0,i.jsxs)(_.z,{children:[(0,i.jsx)(f.OvN,{}),"Add model"]})})]})]})})]})}}},function(e){e.O(0,[3623,9017,3416,8101,5193,7649,5109,1773,3875,4181,1929,2990,8256,1166,2138,2900,2888,9774,179],function(){return e(e.s=58460)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.