86 lines
17 KiB
JavaScript
86 lines
17 KiB
JavaScript
import { app } from "/scripts/app.js";
|
|
|
|
const NODE_NAME = "DumasAnchorStyle";
|
|
const STYLE_INPUT = "anchor_style";
|
|
const DESCRIPTION_INPUT = "style_description";
|
|
const H3_NOTE = " Keep this anchor focused on persistent camera language, lighting, texture, environment treatment, and tone; do not name characters or describe one-off actions.";
|
|
const PRESETS = {
|
|
"cinematic action movie": "Big-screen action cinema with assertive visual storytelling: dynamic camera placement, strong forward momentum, crisp geography, muscular lighting contrast, practical atmosphere, and a sense of physical consequence. Favor heroic framing, controlled handheld energy or motivated tracking moves, dramatic silhouettes, tasteful lens flares, impact-driven pacing, and polished studio spectacle without drifting into comic-book unreality unless the shot explicitly asks for it." + H3_NOTE,
|
|
"comedy": "Play the scene for comedic readability and timing: clear staging, expressive performances, slightly heightened reactions, clean eyelines, and visual beats that leave room for the joke to land. Use bright approachable lighting, grounded but playful production design, readable framing, and a tone that feels observant, awkward, or absurd without becoming broad parody unless the action supports it." + H3_NOTE,
|
|
"found footage": "Captured as raw found-footage material by someone physically present in the scene: imperfect handheld movement, reactive reframing, clipped composition, sudden zooms or focus hunts, practical exposure changes, and the feeling that the camera operator is discovering events in real time. Keep the image messy but legible, accidental rather than cinematic, with authentic panic, hesitation, and ambient noise." + H3_NOTE,
|
|
"90s sitcom": "Classic 1990s multi-camera sitcom language: bright even stage lighting, cozy production design, clean master coverage, medium-wide proscenium framing, fast readable blocking, and performances calibrated for studio audience laughs. The world should feel warm, slightly idealized, and television-friendly, with practical interiors, punchy pauses, and visual simplicity that prioritizes character business." + H3_NOTE,
|
|
"mobile/cell phone captured": "Looks like it was shot casually on a phone by an ordinary person: vertical-video instincts even when the frame is horizontal, imperfect stabilization, auto-exposure breathing, clipped highlights, shallow device-grade dynamic range, and opportunistic framing. Keep it intimate, immediate, and plausibly amateur, with sudden pans, uncertain focus, and informal proximity that feel genuinely captured." + H3_NOTE,
|
|
"news broadcast": "Television news coverage with clear institutional polish: composed framing, practical key lighting, sober color balance, authoritative pacing, and a documentarian sense of informational clarity. Favor reporter or live-hit visual grammar, observational cutaway logic, steady camera operation, concise emphasis, and a tone that feels current, factual, and broadcast-safe rather than entertainment-first." + H3_NOTE,
|
|
"prestige tv drama": "Prestige television drama with premium streaming polish: restrained confidence, textured naturalism, nuanced performances, motivated camera movement, and carefully shaped practical lighting. The mood should feel mature and expensive, with layered production design, cinematic color separation, and emotionally observant framing that trusts silence and subtext." + H3_NOTE,
|
|
"psychological thriller": "Unsettling psychological-thriller grammar: controlled tension, negative space, ambiguous visual information, subtle distortion of normality, and lighting that suggests emotional danger more than physical spectacle. Favor lingering compositions, invasive close-ups, reflective surfaces, uneasy stillness, and a slow escalation of dread." + H3_NOTE,
|
|
"horror": "Lean into horror atmosphere and threat: moody low-key lighting, oppressive space, directional contrast, tactile production texture, and suspenseful framing that weaponizes what is barely seen. The scene should feel unsafe and anticipatory, with sound-implied menace, uneasy empty areas in frame, and a commitment to dread over cheap chaos." + H3_NOTE,
|
|
"science fiction epic": "Expansive science-fiction worldbuilding with polished futuristic scale: elegant production design, disciplined visual effects logic, atmospheric depth, and camera language that makes technology feel integrated and believable. Balance awe with clarity, using sleek surfaces, volumetric light, controlled color motifs, and a sense of society beyond the immediate shot." + H3_NOTE,
|
|
"space opera": "Large-scale space opera with mythic emotion and visual grandeur: bold silhouettes, operatic lighting, sweeping camera movement, heroic compositions, and a heightened sense of destiny. Keep the worlds rich and theatrical, with dramatic color, iconic staging, and spectacle that feels earnest and adventurous." + H3_NOTE,
|
|
"western": "Cinematic western visual language: expansive landscapes, strong horizon lines, weathered textures, harsh natural light, deliberate blocking, and a sense of moral tension embedded in open space. Favor patient compositions, boots-on-dust realism, iconic stand-off geometry, and tactile period detail without romanticizing away the grit." + H3_NOTE,
|
|
"neo-noir": "Neo-noir mood with urban tension and seductive darkness: hard contrast, reflective surfaces, sodium vapor or neon accents, morally complicated framing, and a sense that every location hides compromise. Use rain, smoke, glass, and deep shadow strategically, with stylish but controlled camera work." + H3_NOTE,
|
|
"period drama": "Refined period-drama treatment with historical texture, tailored production design, graceful camera movement, and careful social observation. Light the world with soft elegance and believable practical motivation, prioritizing fabric, architecture, etiquette, and emotional restraint over flashy stylization." + H3_NOTE,
|
|
"documentary vérité": "Observational documentary vérité: minimally intrusive camera behavior, natural available light, patient real-time watchfulness, and an emphasis on lived-in truth over visual perfection. The frame can breathe, drift, and adjust as events unfold, but it should always feel honestly present rather than staged." + H3_NOTE,
|
|
"music video": "Stylized music-video direction with strong visual authorship: rhythmic movement, bold color design, heightened pose, graphic composition, and a willingness to prioritize vibe and image over literal realism. Keep it polished and intent-driven, with kinetic transitions, fashion-forward staging, and synchronized intensity." + H3_NOTE,
|
|
"luxury commercial": "Premium commercial polish aimed at aspiration and desirability: immaculate composition, glossy surfaces, refined lighting control, slow confident camera movement, and tactile focus on premium materials. Everything should feel precise, expensive, and seductively curated, with no accidental mess unless it serves the concept." + H3_NOTE,
|
|
"true crime reenactment": "True-crime reenactment style with documentary dramatization: moody but legible lighting, restrained suspense, partial visual withholding, and a tone that suggests reconstruction rather than action filmmaking. Use practical locations, careful anonymity or selective detail, and sober tension that feels broadcast-doc adjacent." + H3_NOTE,
|
|
"surveillance / cctv": "Fixed surveillance-camera capture with institutional detachment: elevated or corner-mounted viewpoint, wide coverage, unflattering perspective, limited dynamic range, compressed detail, and an impersonal observational tone. Avoid cinematic composition; the power comes from banality, distance, and timestamp-era bluntness." + H3_NOTE,
|
|
"bodycam": "Police or security bodycam perspective: chest-mounted, wide-angle, unstable, close to breath and motion, with abrupt tilts, partial occlusion, clipped framing, and urgent first-person proximity. The footage should feel evidentiary and high-stress, more reactive than composed, while remaining coherent enough to follow action." + H3_NOTE,
|
|
"vlog / creator video": "Online creator or vlog visual style: personable direct address, flattering but casual framing, expressive presentation, and a self-aware sense of on-camera performance. Lighting should feel creator-friendly and approachable, with clean image quality, lifestyle polish, and a balance between authenticity and charisma." + H3_NOTE,
|
|
"anime cinematic": "High-end anime feature or prestige series look translated into shot design: expressive composition, dynamic perspective, graphic silhouette readability, emotionally heightened staging, and clean intentional shape language. Push atmosphere, color motifs, and dramatic key moments while keeping spatial storytelling clear." + H3_NOTE,
|
|
"indie mumblecore": "Low-budget indie mumblecore naturalism: intimate handheld or locked-off simplicity, imperfect but observant framing, natural light or modest practicals, and performances that feel conversational rather than plot-driven. Let awkward pauses, environmental plainness, and human messiness carry the tone instead of visual over-design." + H3_NOTE,
|
|
"elevated fantasy": "Sophisticated fantasy realism with mythic texture and grounded physical detail: rich environments, atmospheric scale, carefully motivated magical elements, and a serious emotional register. The world should feel old, inhabited, and culturally specific, with visual wonder rooted in tactile materials rather than generic glow." + H3_NOTE,
|
|
"procedural cop show": "Mainstream procedural television style: efficient visual clarity, stable coverage, lightly stylized realism, and quick storytelling that privileges evidence, reactions, and spatial logic. Use functional but polished lighting, confident blocking, and a tone that feels network-accessible, competent, and case-driven." + H3_NOTE,
|
|
"romantic drama": "Emotion-first romantic drama treatment: tender close observation, flattering naturalistic light, soft but not mushy contrast, and framing that prioritizes vulnerability, chemistry, and meaningful silence. The scene should feel intimate, earnest, and visually attentive to touch, glance, and emotional hesitation." + H3_NOTE,
|
|
"grindhouse exploitation": "Aggressive grindhouse/exploitation texture: rough-edged energy, dirty contrast, oversaturated or faded color bias, abrasive zooms, tactile film wear vibes, and sensational staging that feels dangerous, pulpy, and disreputable. Keep the image gleefully imperfect and confrontational rather than polished." + H3_NOTE,
|
|
"video essay b-roll": "Thoughtful video-essay b-roll style: visually articulate, idea-supporting imagery with tasteful motion, strong graphic clarity, and composition that feels editorially useful. The tone should be polished but not flashy, descriptive rather than dramatic, with images that communicate theme, context, and texture efficiently." + H3_NOTE,
|
|
"reality tv": "Unscripted reality-TV coverage: reactive zooms, multiple-camera energy implied in the framing, practical interiors, performance-aware spontaneity, and a tone that amplifies interpersonal drama. Keep it bright, legible, and emotionally available, with visual beats that feel captured in the moment rather than authored." + H3_NOTE,
|
|
"mockumentary": "Dry mockumentary television language: documentary-adjacent framing, subtle handheld correction, practical lighting, awkwardly observational composition, and a restrained deadpan tone. Favor unshowy zooms, banal office or domestic realism, and the sense that the camera crew is tolerated but not invisible." + H3_NOTE,
|
|
"arthouse european drama": "Arthouse European drama with patient formal control: composed frames, long takes, naturalistic light, architectural blocking, and emotional understatement. Favor stillness, social texture, understated color, and a feeling of psychological interiority carried by space, rhythm, and observation." + H3_NOTE,
|
|
"heist thriller": "Precision heist-thriller treatment: controlled camera motion, spatial legibility, cool confidence, metallic surfaces, disciplined blocking, and tension built through logistics and timing. Keep the atmosphere sleek, high-competence, and pressure-driven, with crisp visual geography and tactile procedural detail." + H3_NOTE,
|
|
"war film": "Grounded war-film intensity: unstable but purposeful camera behavior, particulate atmosphere, desaturated or earth-heavy color, physical debris, and a sense of fatigue under pressure. Favor battlefield confusion held inside readable geography, practical smoke, dirty textures, and severe consequential realism." + H3_NOTE,
|
|
"cyberpunk neon": "Dense cyberpunk-neon treatment: saturated artificial color, wet reflective surfaces, layered signage glow, polluted atmosphere, and a future built from crowding, commerce, and exhaustion. Favor deep perspective, volumetric haze, mixed light temperatures, and a sleek but grimy high-tech urban mood." + H3_NOTE,
|
|
"teen drama": "Contemporary teen-drama polish: emotionally legible framing, attractive soft-contrast lighting, heightened color styling, and a tone tuned to vulnerability, longing, status, and social friction. Keep the world glossy but recognizably lived-in, with image-making that feels youthful, immediate, and emotionally open." + H3_NOTE,
|
|
"soap opera": "Daytime soap-opera visual grammar: bright even lighting, clean coverage, dramatic reaction framing, polished interiors, and emotional emphasis that reads quickly and clearly. Favor smooth camera operation, attractive presentation, and heightened sincerity over realism or subtle restraint." + H3_NOTE,
|
|
"sports broadcast": "Live sports-broadcast treatment: long-lens observation, decisive coverage, graphic clarity, crowd-scale energy, and camera choices that prioritize play readability and event momentum. Keep the look live, crisp, and production-truck efficient rather than cinematic, with fast reframing and institutional polish." + H3_NOTE,
|
|
"nature documentary": "Premium nature-documentary look: patient long-lens observation, environmental atmosphere, tactile weather detail, and a sense of scale that respects habitat and natural behavior. Favor pristine image clarity, measured camera movement, dawn or dusk richness, and reverent attention to terrain, foliage, and light." + H3_NOTE,
|
|
"travel vlogger": "Travel-vlogger presentation with upbeat personal immediacy: lightweight camera movement, lifestyle polish, sunlit color, enthusiastic visual curiosity, and framing that alternates between direct address and scenic show-and-tell. Keep the image accessible, glossy, and experience-forward without becoming luxury-commercial stiff." + H3_NOTE,
|
|
"cooking show": "Food-television treatment with appetizing clarity: warm flattering light, clean overheads or medium coverage, tactile ingredient detail, and a polished domestic-professional tone. Favor inviting color, crisp texture, steamy atmosphere, and visual readability that makes surfaces, tools, and food prep feel satisfying." + H3_NOTE,
|
|
"public access tv": "Low-budget public-access television look: flat lighting, basic cameras, earnest staging, local-studio color, and awkwardly sincere presentation. Keep the image slightly dated, mildly cheap, and charmingly unvarnished, with simple framing and a community-TV sense of limited means but real enthusiasm." + H3_NOTE,
|
|
"infomercial": "Direct-response infomercial style: bright high-key lighting, clear product-first framing, emphatic readability, friendly presentation, and a tone of practical persuasion. Favor obvious utility, clean set styling, smooth camera movement, and visually demonstrative simplicity over mood or subtle atmosphere." + H3_NOTE,
|
|
"courtroom drama": "Courtroom-drama treatment with institutional gravity: balanced coverage, wood-and-fabric texture, controlled camera moves, measured authority, and tension carried through testimony, reactions, and procedure. Keep the look sober, formal, and performance-attentive, with clean eyelines and serious architectural presence." + H3_NOTE,
|
|
"fantasy adventure": "Rousing fantasy-adventure language: scenic scale, adventurous clarity, tactile costume-and-prop detail, and camera movement that feels exploratory rather than oppressive. Favor storybook geography, weathered materials, golden or stormy atmosphere, and a tone of peril, wonder, and forward motion." + H3_NOTE,
|
|
};
|
|
|
|
function findWidget(node, name) {
|
|
return (node.widgets || []).find((widget) => widget?.name === name) || null;
|
|
}
|
|
|
|
app.registerExtension({
|
|
name: "Dumas.AnchorStyle",
|
|
async beforeRegisterNodeDef(nodeType, nodeData) {
|
|
if (nodeData?.name !== NODE_NAME) return;
|
|
|
|
const originalOnNodeCreated = nodeType.prototype.onNodeCreated;
|
|
|
|
nodeType.prototype.onNodeCreated = function onNodeCreated() {
|
|
const created = originalOnNodeCreated?.apply(this, arguments);
|
|
const styleWidget = findWidget(this, STYLE_INPUT);
|
|
const descriptionWidget = findWidget(this, DESCRIPTION_INPUT);
|
|
if (!styleWidget || !descriptionWidget) return created;
|
|
|
|
const originalCallback = styleWidget.callback;
|
|
styleWidget.callback = (...args) => {
|
|
const selected = String(styleWidget.value || "");
|
|
if (Object.hasOwn(PRESETS, selected)) {
|
|
descriptionWidget.value = PRESETS[selected];
|
|
descriptionWidget.inputEl?.dispatchEvent(new Event("input", { bubbles: true }));
|
|
}
|
|
this.setDirtyCanvas?.(true, true);
|
|
return originalCallback?.apply(styleWidget, args);
|
|
};
|
|
|
|
return created;
|
|
};
|
|
},
|
|
});
|