PageSourceSearch

https://ytprompt.ai/assets/ImageToImage-CcqKXLxL.js

js ytprompt.ai collected 2026-10-05 14:49:36 UTC 24,792 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-markdown-Bj2spg3f.js";import{d as Se,r}from"./vendor-react-B-0p-RVf.js";import{b as R}from"./index-45gJDKBt.js";import{M as J,a as ze}from"./ModelGenerationOptions-CPPuyqkY.js";import{u as ke,A as _e}from"./AnalyzerModelSelector-CDw69Dc9.js";import{P as G,H as Z,X as H,s as X,aU as q,aa as we,E as K,an as Ce,T as Ie,b0 as M,ag as Re,I as Y,a_ as ee,ap as Fe,aj as Q,at as Be,O as De,e as Te,q as Me,ae as We}from"./vendor-icons-D-5f6XKt.js";import"./vendor-misc-D0V4jby4.js";import"./vendor-i18n-D8j9R6P3.js";function Ae(S){if(!S)return"";try{const u=new Date(S*1e3),x=Math.floor((new Date-u)/6e4);if(x<1)return"Just now";if(x<60)return`${x}m ago`;const h=Math.floor(x/60);if(h<24)return`${h}h ago`;const s=Math.floor(h/24);return s<7?`${s}d ago`:u.toLocaleDateString()}catch{return""}}function Ee({refreshTrigger:S,onLoadIntoGenerator:u}){const[b,x]=r.useState([]),[h,s]=r.useState(!0),[F,z]=r.useState(null),[I,y]=r.useState(null),k=r.useCallback(()=>{s(!0),R.get("/api/tools/image-to-image/history").then(i=>x(i.data?.entries||[])).catch(()=>x([])).finally(()=>s(!1))},[]);r.useEffect(()=>{k()},[S,k]);const l=async i=>{if(window.confirm("Delete this generated image? This cannot be undone.")){z(i.entry_id);try{await R.delete(`/api/tools/image-to-image/${i.entry_id}`),x(g=>g.filter(d=>d.entry_id!==i.entry_id)),I===i.entry_id&&y(null)}catch{}finally{z(null)}}},_=i=>{const g=document.createElement("a");g.href=`/api/tools/image-to-image/${i.entry_id}/image`,g.download=`image_to_image_${i.entry_id}.png`,g.click()};return h?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"32px 0",color:"var(--text-muted)",fontSize:14,justifyContent:"center"},children:[e.jsx(M,{size:16,className:"spin"})," Loading history…"]}):b.length===0?e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"48px 24px",border:"1px solid var(--border)",textAlign:"center"},children:[e.jsx(Z,{size:32,style:{color:"var(--text-muted)",marginBottom:12}}),e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"var(--text)",margin:"0 0 8px"},children:"No history yet"}),e.jsx("p",{style:{fontSize:14,color:"var(--text-muted)",margin:0},children:"Generate an image to see it appear here"})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[e.jsxs("span",{style:{fontSize:13,color:"var(--text-muted)",fontWeight:500},children:[b.length," generation",b.length!==1?"s":""]}),e.jsxs("button",{onClick:k,className:"btn btn-sm",style:{display:"flex",alignItems:"center",gap:4,fontSize:12,background:"var(--bg)",color:"var(--text)",border:"1px solid var(--border)"},children:[e.jsx(De,{size:12})," Refresh"]})]}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:16},children:b.map(i=>{const g=I===i.entry_id,d=i.composite_prompt||i.prompt||"",W=d.length>100?d.slice(0,100)+"…":d;return e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,border:"1px solid var(--border)",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.has_image?e.jsxs("div",{style:{position:"relative",background:"var(--bg)",flexShrink:0},children:[e.jsx("img",{src:`/api/tools/image-to-image/${i.entry_id}/image`,alt:"Generated",style:{width:"100%",height:200,objectFit:"cover",display:"block"},onError:B=>{B.target.style.display="none"}}),e.jsx("div",{style:{position:"absolute",top:8,left:8,background:i.mode==="multi"?"rgba(99,102,241,0.9)":"rgba(139,92,246,0.9)",borderRadius:6,padding:"3px 8px",fontSize:10,fontWeight:700,color:"#fff",display:"flex",alignItems:"center",gap:4},children:i.mode==="multi"?e.jsxs(e.Fragment,{children:[e.jsx(Te,{size:10})," Multi-Fusion"]}):e.jsxs(e.Fragment,{children:[e.jsx(H,{size:10})," Single"]})})]}):e.jsx("div",{style:{height:120,background:"var(--bg)",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(H,{size:28,style:{color:"var(--text-muted)"}})}),e.jsxs("div",{style:{padding:"14px 16px",flex:1,display:"flex",flexDirection:"column",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[i.aspect_ratio&&e.jsx("span",{style:{fontSize:10,fontWeight:600,padding:"2px 7px",borderRadius:20,background:"rgba(16,185,129,0.1)",color:"#10B981"},children:i.aspect_ratio}),i.model_name&&e.jsx("span",{style:{fontSize:10,fontWeight:500,color:"var(--text-muted)",padding:"2px 7px",borderRadius:20,background:"var(--bg)",border:"1px solid var(--border)"},children:i.model_name})]}),e.jsxs("div",{children:[e.jsx("p",{style:{fontSize:12,color:"var(--text)",lineHeight:1.5,margin:0},children:g?d:W}),d.length>100&&e.jsx("button",{onClick:()=>y(g?null:i.entry_id),style:{background:"none",border:"none",color:"var(--primary)",fontSize:11,fontWeight:600,cursor:"pointer",padding:"2px 0",marginTop:2},children:g?"Show less":"Show more"})]}),i.instructions&&e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",background:"var(--bg)",borderRadius:6,padding:"6px 8px",lineHeight:1.4},children:[e.jsx("span",{style:{fontWeight:600},children:"Instructions: "}),i.instructions.length>80?i.instructions.slice(0,80)+"…":i.instructions]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:"auto"},children:[e.jsx(Me,{size:10,style:{color:"var(--text-muted)"}}),e.jsx("span",{style:{fontSize:11,color:"var(--text-muted)"},children:Ae(i.created_at)})]}),e.jsxs("div",{style:{display:"flex",gap:6,marginTop:4},children:[i.has_image&&e.jsxs("button",{onClick:()=>_(i),className:"btn btn-sm",style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:4,fontSize:11,background:"var(--primary)",color:"#fff",border:"none"},children:[e.jsx(ee,{size:11})," Download"]}),e.jsx("button",{onClick:()=>l(i),disabled:F===i.entry_id,className:"btn btn-sm",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,fontSize:11,background:"rgba(239,68,68,0.06)",color:"#EF4444",border:"1px solid rgba(239,68,68,0.2)",...i.has_image?{}:{flex:1}},children:F===i.entry_id?e.jsx(M,{size:11,className:"spin"}):e.jsx(We,{size:11})})]})]})]},i.entry_id)})})]})}
1const Ge=["Logo","Background","Style Reference","Text/Name","Character","Object"];function qe(){const S=Se(),[u,b]=r.useState("generate"),[x,h]=r.useState(0),[s,F]=r.useState("single"),[z,I]=r.useState(null),[y,k]=r.useState(null),[l,_]=r.useState([]),[i,g]=r.useState(""),[d,W]=r.useState("16:9"),[B,D]=r.useState(!1),[p,te]=r.useState(null),[v,L]=r.useState(""),{models:w}=ke();r.useEffect(()=>{if(!v&&w&&w.length>0){const t=w.find(a=>a.is_default)||w[0];L(String(t.id))}},[w,v]);const[ie,ae]=r.useState(!1),[re,oe]=r.useState({}),[He,Le]=r.useState(!1),[T,m]=r.useState(""),[n,f]=r.useState(null),N=r.useRef(null),P=r.useRef(null),[ne,A]=r.useState(!1),[$,O]=r.useState(""),[j,V]=r.useState(!1),[E,se]=r.useState(null),le=t=>{const a=t.target.files[0];if(!a)return;I(a),f(null),m("");const o=new FileReader;o.onload=c=>k(c.target.result),o.readAsDataURL(a)},de=t=>{t.preventDefault();const a=t.dataTransfer.files[0];if(a&&a.type.startsWith("image/")){I(a),f(null),m("");const o=new FileReader;o.onload=c=>k(c.target.result),o.readAsDataURL(a)}},ce=t=>{const a=Array.from(t.target.files);U(a)},ge=t=>{t.preventDefault();const a=Array.from(t.dataTransfer.files).filter(o=>o.type.startsWith("image/"));U(a)},U=t=>{if(l.length+t.length>6){m("Maximum 6 images allowed");return}m(""),f(null);const a=[];t.forEach((o,c)=>{const C=new FileReader;C.onload=ve=>{a.push({file:o,preview:ve.target.result,label:"",caption:null}),a.length===t.length&&_(je=>[...je,...a])},C.readAsDataURL(o)})},pe=t=>{_(a=>a.filter((o,c)=>c!==t)),f(null)},me=(t,a)=>{_(o=>o.map((c,C)=>C===t?{...c,label:a}:c))},xe=async()=>{if(z){D(!0),m(""),f(null);try{const t=new FormData;t.append("image",z),t.append("instructions",i),t.append("aspect_ratio",d),p?.id&&t.append("image_model_id",p.id),p?._imageapi_sub_model&&t.append("imageapi_model_slug",p._imageapi_sub_model),v&&t.append("analyzer_model_id",v);const a=await R.post("/api/tools/image-to-image",t,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4});f({...a.data,mode:"single"}),h(o=>o+1)}catch(t){m(t.response?.data?.detail||"Failed to generate image")}finally{D(!1)}}},ue=async()=>{if(!(l.length<1)){D(!0),m(""),f(null);try{const t=new FormData;l.forEach((o,c)=>{t.append("images",o.file),t.append("labels",o.label||`Image ${c+1}`)}),t.append("instructions",i),t.append("aspect_ratio",d),p?.id&&t.append("image_model_id",p.id),p?._imageapi_sub_model&&t.append("imageapi_model_slug",p._imageapi_sub_model),v&&t.append("analyzer_model_id",v);const a=await R.post("/api/tools/image-to-image/multi",t,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4});a.data.captions&&_(o=>o.map((c,C)=>({...c,caption:a.data.captions[C]?.caption||null}))),f({...a.data,mode:"multi"}),h(o=>o+1)}catch(t){m(t.response?.data?.detail||"Failed to generate image")}finally{D(!1)}}},fe=()=>{if(!n?.image)return;const t=document.createElement("a");t.href=`data:image/png;base64,${n.image}`,t.download=`generated_image_${Date.now()}.png`,t.click()},he=t=>{navigator.clipboard.writeText(t)},be=async()=>{if(n?.image){V(!0),m("");try{const t=await R.post("/api/tools/extend-to-studio",{source_type:"image",source_tool:"image_to_image",image_base64:n.image,next_scene_prompt:$.trim()||n.composite_prompt||n.prompt||"",aspect_ratio:d,source_prompt:n.composite_prompt||n.prompt||"",...E?.id?{video_model_id:E.id}:{}});S(`/p/${t.data.studio_run_id}`)}catch(t){m(t.response?.data?.detail||"Failed to convert to video"),V(!1)}}},ye=s==="single"?!!z:l.length>0;return e.jsxs("div",{className:"fade-in",style:{maxWidth:1e3,margin:"0 auto"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:24,flexWrap:"wrap",gap:12},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:24,fontWeight:700,color:"var(--text)",margin:0},children:"Image to Image"}),e.jsx("p",{style:{fontSize:14,color:"var(--text-muted)",margin:"4px 0 0"},children:"Upload images, add AI instructions, and generate a new image"})]}),e.jsx("div",{style:{display:"flex",gap:4,background:"var(--bg)",borderRadius:10,padding:4},children:[{key:"generate",label:"Generate",icon:G},{key:"history",label:"History",icon:Z}].map(t=>e.jsxs("button",{onClick:()=>b(t.key),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 18px",borderRadius:8,border:"none",cursor:"pointer",fontSize:13,fontWeight:600,background:u===t.key?"var(--primary)":"transparent",color:u===t.key?"#fff":"var(--text-muted)",transition:"all 0.2s"},children:[e.jsx(t.icon,{size:14})," ",t.label]},t.key))})]}),u==="history"&&e.jsx(Ee,{refreshTrigger:x}),u==="generate"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",gap:4,marginBottom:20,background:"var(--bg)",borderRadius:10,padding:4,width:"fit-content"},children:[{key:"single",label:"Single Image",icon:H},{key:"multi",label:"Multi-Image Fusion",icon:X}].map(t=>e.jsxs("button",{onClick:()=>{F(t.key),f(null),m("")},style:{display:"flex",alignItems:"center",gap:6,padding:"8px 18px",borderRadius:8,border:"none",cursor:"pointer",fontSize:13,fontWeight:600,background:s===t.key?"var(--primary)":"transparent",color:s===t.key?"#fff":"var(--text-muted)",transition:"all 0.2s"},children:[e.jsx(t.icon,{size:14})," ",t.label]},t.key))}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:n?"1fr 1fr":"1fr",gap:20},children:[e.jsxs("div",{children:[s==="single"?e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"24px",border:"1px solid var(--border)",marginBottom:20},children:[e.jsxs("h3",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:16,display:"flex",alignItems:"center",gap:8},children:[e.jsx(q,{size:16,style:{color:"#8B5CF6"}})," Source Image"]}),e.jsx("div",{onClick:()=>N.current?.click(),onDrop:de,onDragOver:t=>t.preventDefault(),style:{border:"2px dashed var(--border)",borderRadius:12,padding:y?0:40,textAlign:"center",cursor:"pointer",background:y?"transparent":"var(--bg)",overflow:"hidden",minHeight:180,display:"flex",alignItems:"center",justifyContent:"center"},children:y?e.jsx("img",{src:y,alt:"Source",style:{maxWidth:"100%",maxHeight:300,objectFit:"contain",borderRadius:8}}):e.jsxs("div",{children:[e.jsx(q,{size:28,style:{color:"var(--primary)",marginBottom:8}}),e.jsx("div",{style:{fontSize:13,fontWeight:600,color:"var(--text)"},children:"Drop image or click to upload"}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:"JPG, PNG, WebP"})]})}),e.jsx("input",{type:"file",ref:N,accept:"image/*",onChange:le,style:{display:"none"}})]}):e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"24px",border:"1px solid var(--border)",marginBottom:20},children:[e.jsxs("h3",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:6,display:"flex",alignItems:"center",gap:8},children:[e.jsx(X,{size:16,style:{color:"#8B5CF6"}})," Source Images"]}),e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:"0 0 16px"},children:"Upload multiple images (logo, background, style, etc.) and AI will analyze and combine them into one image."}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:12,marginBottom:16},children:[l.map((t,a)=>e.jsxs("div",{style:{position:"relative",borderRadius:12,overflow:"hidden",border:"1px solid var(--border)",background:"var(--bg)"},children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("img",{src:t.preview,alt:`Source ${a+1}`,style:{width:"100%",height:100,objectFit:"cover"}}),e.jsx("button",{onClick:()=>pe(a),style:{position:"absolute",top:4,right:4,width:22,height:22,borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.6)",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0},children:e.jsx(we,{size:12})}),t.caption&&e.jsxs("div",{style:{position:"absolute",bottom:4,left:4,right:4,background:"rgba(0,0,0,0.7)",borderRadius:6,padding:"3px 6px",fontSize:9,color:"#fff",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t.caption,children:[e.jsx(K,{size:8,style:{marginRight:3,verticalAlign:"middle"}}),t.caption]})]}),e.jsx("div",{style:{padding:8},children:e.jsxs("select",{value:t.label,onChange:o=>me(a,o.target.value),style:{width:"100%",padding:"4px 6px",borderRadius:6,fontSize:11,border:"1px solid var(--border)",background:"var(--card-bg)",color:"var(--text)",cursor:"pointer"},children:[e.jsx("option",{value:"",children:"Label (optional)"}),Ge.map(o=>e.jsx("option",{value:o,children:o},o))]})})]},a)),l.length<6&&e.jsxs("div",{onClick:()=>P.current?.click(),onDrop:ge,onDragOver:t=>t.preventDefault(),style:{borderRadius:12,border:"2px dashed var(--border)",background:"var(--bg)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",minHeight:140,padding:12,transition:"border-color 0.2s"},onMouseEnter:t=>t.currentTarget.style.borderColor="var(--primary)",onMouseLeave:t=>t.currentTarget.style.borderColor="var(--border)",children:[e.jsx(Ce,{size:22,style:{color:"var(--primary)",marginBottom:6}}),e.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text)",textAlign:"center"},children:"Add Image"}
1),e.jsxs("div",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:[l.length,"/6"]})]})]}),e.jsx("input",{type:"file",ref:P,accept:"image/*",multiple:!0,onChange:ce,style:{display:"none"}}),l.length>0&&e.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:6,padding:"10px 12px",background:"rgba(139,92,246,0.04)",borderRadius:8,border:"1px solid rgba(139,92,246,0.1)"},children:[e.jsx(Ie,{size:12,style:{color:"var(--primary)",marginTop:2}}),e.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[l.length," image",l.length>1?"s":""," added. AI will analyze each image, extract visual elements, and create a combined prompt."]})]})]}),e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"24px",border:"1px solid var(--border)",marginBottom:20},children:[e.jsxs("h3",{style:{fontSize:15,fontWeight:700,color:"var(--text)",marginBottom:16,display:"flex",alignItems:"center",gap:8},children:[e.jsx(G,{size:16,style:{color:"#F59E0B"}})," Options"]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:6,display:"block"}
1,children:s==="multi"?"AI Instructions":"Instructions (optional)"}),e.jsx("textarea",{value:i,onChange:t=>g(t.target.value),placeholder:s==="multi"?"e.g., Create a YouTube thumbnail with the logo in top-left, name text centered, gaming background with dark overlay, neon style...":"e.g., Make it look like a watercolor painting, change background to sunset...",className:"input",rows:s==="multi"?4:3,style:{width:"100%",resize:"vertical"}}),s==="multi"&&e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:"Describe how the images should be combined. The more specific, the better the result."})]}),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:6,display:"block"},children:"Aspect Ratio"}),e.jsx("div",{style:{display:"flex",gap:8},children:["16:9","9:16","1:1"].map(t=>e.jsx("button",{onClick:()=>W(t),style:{padding:"6px 16px",borderRadius:8,cursor:"pointer",fontSize:13,fontWeight:600,border:"1px solid var(--border)",background:d===t?"var(--primary)":"var(--bg)",color:d===t?"#fff":"var(--text)",transition:"all 0.2s"},children:t},t))})]})]}),e.jsx(_e,{models:w,selectedId:v,onSelect:L}),e.jsx(J,{category:"image",value:p,onChange:te,onAvailabilityChange:ae,label:"Image Generation Model"}),(p?.settings?.generation_options||[]).filter(t=>t.enabled!==!1).length>0&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:16,marginBottom:16},children:e.jsx(ze,{model:p,values:re,onChange:oe,excludeKeys:["aspect_ratio"]})}),e.jsx("button",{className:"btn btn-primary",onClick:s==="single"?xe:ue,disabled:!ie||!ye||B,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"12px"},children:B?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:16,className:"spin"})," ",s==="multi"?"Analyzing & Generating...":"Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{size:16})," ",s==="multi"?`Analyze ${l.length} Image${l.length!==1?"s":""} & Generate`:"Generate New Image"]})})]}),n&&e.jsxs("div",{children:[e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"24px",border:"1px solid var(--border)",marginBottom:20},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[e.jsxs("h3",{style:{fontSize:15,fontWeight:700,color:"var(--text)",margin:0,display:"flex",alignItems:"center",gap:8},children:[e.jsx(Re,{size:16,style:{color:"#10B981"}})," Generated Image"]}),e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsxs("button",{onClick:()=>{A(!0),O(n.composite_prompt||n.prompt||"")},className:"btn btn-sm",style:{display:"flex",alignItems:"center",gap:4,fontSize:12,background:"linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.1))",border:"1px solid rgba(139,92,246,0.3)",color:"#8B5CF6"},children:[e.jsx(Y,{size:13})," Video"]}),e.jsxs("button",{onClick:fe,className:"btn btn-sm",style:{display:"flex",alignItems:"center",gap:4,fontSize:12,background:"var(--primary)",color:"#fff",border:"none"},children:[e.jsx(ee,{size:13})," Download"]})]})]}),n.image&&e.jsx("img",{src:`data:image/png;base64,${n.image}`,alt:"Generated",style:{width:"100%",borderRadius:10,maxHeight:400,objectFit:"contain"}})]}),n.mode==="multi"&&n.captions&&e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"20px",border:"1px solid var(--border)",marginBottom:16},children:[e.jsxs("h4",{style:{fontSize:13,fontWeight:700,color:"var(--text)",margin:"0 0 12px",display:"flex",alignItems:"center",gap:6},children:[e.jsx(K,{size:14,style:{color:"#3B82F6"}})," Image Analysis"]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:n.captions.map((t,a)=>e.jsxs("div",{style:{background:"var(--bg)",borderRadius:8,padding:"10px 12px",border:"1px solid var(--border)"},children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,color:"var(--primary)",marginBottom:4,textTransform:"uppercase",letterSpacing:"0.5px"},children:t.label}),e.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.5},children:t.caption})]},a))})]}),e.jsxs("div",{style:{background:"var(--card-bg)",borderRadius:14,padding:"20px",border:"1px solid var(--border)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[e.jsx("h4",{style:{fontSize:13,fontWeight:700,color:"var(--text)",margin:0},children:n.mode==="multi"?"Composite Prompt":"Caption"}),e.jsx("button",{onClick:()=>he(n.composite_prompt||n.prompt||""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",padding:4},children:e.jsx(Fe,{size:13})})]}),n.mode==="single"&&n.caption&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"var(--bg)",borderRadius:8,padding:"10px 12px",fontSize:12,color:"var(--text-muted)",lineHeight:1.5,marginBottom:8},children:n.caption}),e.jsx("h4",{style:{fontSize:13,fontWeight:700,color:"var(--text)",marginBottom:6},children:"Full Prompt"})]}),e.jsx("div",{style:{background:"var(--bg)",borderRadius:8,padding:"10px 12px",fontSize:12,color:"var(--text)",lineHeight:1.5},children:n.composite_prompt||n.prompt})]})]})]}),T&&e.jsxs("div",{style:{padding:"12px 16px",borderRadius:10,marginTop:20,fontSize:13,background:"rgba(239,68,68,0.1)",color:"#EF4444",border:"1px solid rgba(239,68,68,0.2)",display:"flex",alignItems:"center",gap:8},children:[e.jsx(Q,{size:16})," ",T]}),ne&&e.jsx("div",{onClick:()=>!j&&A(!1),style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:20},children:e.jsxs("div",{onClick:t=>t.stopPropagation(),style:{background:"var(--card-bg)",borderRadius:20,padding:28,maxWidth:500,width:"100%",border:"1px solid var(--border)"},children:[e.jsxs("h2",{style:{fontSize:18,fontWeight:700,color:"var(--text)",marginBottom:6,display:"flex",alignItems:"center",gap:10},children:[e.jsx(Y,{size:20,style:{color:"#8B5CF6"}})," Convert to Video in Studio"]}),e.jsx("p",{style:{fontSize:13,color:"var(--text-muted)",marginBottom:20},children:"This image will be used as the starting frame for a new Video Studio project. The AI will animate it into a video."}),T&&e.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12.5,background:"rgba(239,68,68,0.1)",color:"#EF4444",border:"1px solid rgba(239,68,68,0.2)",display:"flex",alignItems:"center",gap:8},children:[e.jsx(Q,{size:14})," ",T]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{display:"block",fontSize:13,fontWeight:600,color:"var(--text)",marginBottom:8}
1,children:"Video Motion Instructions"}),e.jsx("textarea",{value:$,onChange:t=>O(t.target.value),placeholder:"Describe the motion and animation for this image... (e.g., 'Camera slowly zooms in, clouds move across the sky')",rows:3,style:{width:"100%",padding:"12px 14px",fontSize:14,border:"1px solid var(--border)",borderRadius:10,background:"var(--bg)",color:"var(--text)",resize:"vertical",outline:"none",fontFamily:"inherit",boxSizing:"border-box"}}),e.jsx("p",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4},children:"Leave empty to use the original image prompt"})]}),e.jsx("div",{style:{marginBottom:20},children:e.jsx(J,{category:"video",value:E,onChange:se,label:"Video Generation Model"})}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx("button",{onClick:()=>A(!1),disabled:j,style:{flex:1,padding:"12px 20px",borderRadius:10,background:"var(--bg)",border:"1px solid var(--border)",color:"var(--text)",fontSize:14,fontWeight:600,cursor:j?"not-allowed":"pointer"},children:"Cancel"}),e.jsx("button",{onClick:be,disabled:j,style:{flex:2,padding:"12px 20px",borderRadius:10,background:j?"var(--border)":"linear-gradient(135deg, #8B5CF6, #6366F1)",color:"#fff",border:"none",fontSize:14,fontWeight:700,cursor:j?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:j?e.jsxs(e.Fragment,{children:[e.jsx(M,{size:16,className:"spin"})," Creating Project..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{size:16})," Open in Video Studio"]})})]})]})})]})]})}export{qe as default};

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.