// Code Custodian File ID: A82F3B10-912E-4D20-B590-C712C41A82E3 # 🎨 Artistly Playbook & CDP Automation Guide ## 1. Route Map & Target Contexts - **Consistent Characters Route:** `https://app.artistly.ai/ai/consistent-characters` - **Fast Image Designer v6 Route:** `https://app.artistly.ai/ai/image-designer-v6` - **AI Art Illustrator Route:** `https://app.artistly.ai/ai/ai-illustrator` - **AI Storybook Studio Route:** `https://app.artistly.ai/ai/ai-storybook-studio` - **Personal Designs Gallery Route:** `https://app.artistly.ai/personal-designs` --- ## 2. Consistent Characters Workflow (`/ai/consistent-characters`) ### Step 1: Category Selection - **Parent Card Container:** `.flex.flex-wrap.justify-center.gap-4` - **Card Element Selector:** `div.group.flex.flex-col.items-center.w-\[85px\].cursor-pointer` - **Categories:** - `Realistic Images` - `3d & 2d Style Images` - `Multi-consistent Characters` - **Interaction Recipe:** Physical coordinate click required via `Input.dispatchMouseEvent` at `getBoundingClientRect()` midpoint. React fiber ignores synthetic JS `.click()`. --- ### Step 2: Character Media Upload & Library Selection - **Media Library Modal Trigger Button:** - Selector: `button` with inner text `"Choose from library"` - Class: `inline-flex disabled:cursor-not-allowed items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm ... bg-primary text-primary-foreground` - Note: Multi-consistent mode renders two distinct slots, each with its own `"Choose from library"` trigger button. - **Media Library Modal Container:** `div[role="dialog"]` / `h2` with text `"Media Library"` - **Character Selection Cards:** `img` elements inside `.group.relative` card containers. - **Close Modal Button:** `button` with inner text `"Close"` or class `absolute right-4 top-4...` - **FilePond Dropzone (Local Upload):** - File Input: `input.filepond--browser[type="file"]` - Remove Character Button: `button.filepond--file-action-button.filepond--action-remove-item` #### Deterministic Selection Recipe 1: UUID / Hash Matching in Media Library To prevent selecting duplicate characters (e.g. "Double Willow"), target character images by their specific CDN hash substring rather than array index: ```javascript // Target Willow (320d7c75) or Arlo (e7495800) const targetHash = '320d7c75'; const img = Array.from(document.querySelectorAll('img')).find(i => i.src && i.src.includes(targetHash)); if (img) { const card = img.closest('.group') || img; card.scrollIntoView({ behavior: 'instant', block: 'center' }); const rect = card.getBoundingClientRect(); // Dispatch physical mouse click at (rect.left + rect.width/2, rect.top + rect.height/2) via CDP } ``` #### Deterministic Selection Recipe 2: Direct FilePond Upload from Disk via CDP (Preferred) To bypass the Media Library modal entirely, use CDP's `DOM.setFileInputFiles` method to load local character DNA master PNGs directly into the slot dropzones: ```python # CDP File Input Injection Recipe doc = cdp.send("DOM.getDocument") # Slot 1 Target Node (Willow) slot1_node = cdp.send("DOM.querySelectorAll", { "nodeId": doc["root"]["nodeId"], "selector": "input.filepond--browser[type='file']" })["nodeIds"][0] cdp.send("DOM.setFileInputFiles", { "files": ["/Volumes/FACTORY_SSD/warezfactory/Artistly_Scout/Characters/Willow/willow_dna_anchor.png"], "nodeId": slot1_node }) # Slot 2 Target Node (Arlo) slot2_node = cdp.send("DOM.querySelectorAll", { "nodeId": doc["root"]["nodeId"], "selector": "input.filepond--browser[type='file']" })["nodeIds"][1] cdp.send("DOM.setFileInputFiles", { "files": ["/Volumes/FACTORY_SSD/warezfactory/Artistly_Scout/Characters/Arlo/arlo_dna_anchor.png"], "nodeId": slot2_node }) ``` --- ### Step 3: Scene Prompt, Aspect Ratio, & Generation #### Prompt Textarea - **Selector:** `textarea` - **Class:** `w-full m-0 py-5 px-5 border-transparent focus:border-transparent focus:ring-0 dark:bg-[#45464B] dark:text-white h-[120px] rounded-3xl text-sm mb-2 border-0 bg-[#F4F6F9] text-gray-600 font-semibold` - **Placeholders:** - Single Character Mode: `Example: Cartoon farmer sitting on bench in the garden` - Multi-Character Mode: `Example: Man and girl playing together in the garden` - **Injection Recipe:** ```javascript const textarea = document.querySelector('textarea'); textarea.focus(); const setter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set; setter.call(textarea, 'Your scene prompt here'); textarea.dispatchEvent(new Event('input', { bubbles: true })); textarea.dispatchEvent(new Event('change', { bubbles: true })); ``` #### Aspect Ratio Selector (``) - **Selector:** Second `select` element on page (`select.dark\:bg-gray-500.px-2.py-2`) - **Options:** `1`, `2`, `3`, `4` #### Generate Button - **Single Character Mode Text:** `Generate Image` - **Multi-Character Mode Text:** `Generate Characters` - **Selector:** `button[type="submit"]` with class `w-max rounded-full bg-[#7042F3] hover:bg-[#7042F3] text-white font-bold py-5 px-8` - **Interaction Recipe:** Physical coordinate click via `Input.dispatchMouseEvent` at `getBoundingClientRect()` midpoint. --- ## 3. AI Art Illustrator (`/ai/ai-illustrator`) ### Step 1: Style Selection - **Style Cards Container:** Viewport grid containing options like `2d Flat`, `8-bit Pixel Style`, `AAA Game Style`, `Adult Coloring Book`, `Anime Style`, `Chibi Style`, `Clip Art`, `Coloring Page`, `Comicbook Illustration`, `Crayon Style`, etc. - **Card Click Selector:** Click midpoint of target style element or parent `div.cursor-pointer`. ### Step 2: Prompt Input & Controls - **Prompt Textarea:** `