feat(ai): draw item names, variables and item lists in chat replies like the editors
A name the model puts in backticks (`Hair Color` or `[[Hair Color]]`) is now a chip like any other mention. Variables read the way the editors draw them: accessors in amber, .neg in red, and the variables the run sets ($iteration, $model_family and the other WP Model Info ones) marked read-only. A list of three or more items shows as an item list with each item's kind, name and category chip.
This commit is contained in:
@@ -8,7 +8,7 @@ This release adds an AI assistant that runs on a model you choose, gives every r
|
||||
The assistant is new and **off by default**. Turn it on in **Settings › AI assistant**. It works with Ollama, LM Studio, llama.cpp or any OpenAI-compatible server on your PC, or with the Claude or OpenAI API and your own key. Keys stay on ComfyUI's side and never go back to the browser. **Test connection** checks the model, its context size and whether it can use tools. Local models need at least 16k of context, and 32k is recommended for chats that take several steps.
|
||||
|
||||
- **Draft with AI.** Every editor has an **AI** button. In the wildcard editor it writes new options in the style of yours, or rewrites, retags, re-weights or removes the ones you select. You tick through a list before anything changes. Fixed values, combines, templates, derivations and constraints get drafts too. With Thinking on Auto a local model answers the panels without thinking, so a 3-option draft takes seconds instead of minutes; a model that thinks anyway is stopped after about 4,000 thinking tokens and asked again, and the working line counts its thinking. Asking for 3 options lands 3 after duplicates are dropped. The rule and text panels see the variables your request is about in full and the rest by name only, about 4,000 fewer tokens on a large library. A name two wildcards share (two Outfit wildcards) is no longer guessed: the panel points at the one you mean by its variable. When new options of a one-thing wildcard (Hair style) also set something else you didn't ask for (an outfit), the panel asks once more without it. A text panel that loops on the same words is stopped after about 1,500 tokens and asked once more, so a stuck template answer comes back in seconds instead of four minutes, and a Fixed values, combine or template draft that leaves out a variable your request names ("$light is warm lamp light") is asked once more for it. Try again and Refine no longer share one "Answer n of m" pager: each request is a line above the answer with its own **try 2 of 3** switcher, different refines of one answer get a **refine 1 of 2** switcher, and refining any try branches from that try, so you can compare tries of the same request side by side. A number in the request now sets **How many** ("draft 6 desert weather options" drafts 6, not 10), also when the chat opens the panel. The model sees the tags each existing option has, and a new tag it puts on every new option, the wildcard's own library tags and negatives nobody asked for are left off and listed under the result. Retag that "adds" a tag keeps the options' other tags, "half as likely" halves each option's current weight instead of setting 0.5 (which made a 0.1 option five times more common), a weight that moves the other way than asked is left out, and a rewrite or retag of "every" option that skips some is asked once more for those.
|
||||
- **Chat.** The **AI** button in the top bar opens a chat that can search your library, test stacks on the real engine and answer from these docs. Changes come back as cards you **Apply** or **Dismiss**, with **Undo**. Type **@** to name an item or **$** for a variable, or select any text in the manager to have it explained. Picked items show as chips while you type, and each reply shows how long it took. Adding a tag to options keeps the tags they had, and a card that takes a tag off every option warns when a constraint still has rules for it. Change cards draw the change the way the editor shows the item: a wildcard edit lists the options it touches with + for new ones, removed ones struck through and old → new for text, share of the draw, tags, negative and fallback, with the untouched ones folded into a count; a change to an item's description, tags, category or rating shows old → new with the category's own chip, and category, tag and bulk cards show library chips instead of lines of text.
|
||||
- **Chat.** The **AI** button in the top bar opens a chat that can search your library, test stacks on the real engine and answer from these docs. Changes come back as cards you **Apply** or **Dismiss**, with **Undo**. Type **@** to name an item or **$** for a variable, or select any text in the manager to have it explained. Picked items show as chips while you type, and each reply shows how long it took. Adding a tag to options keeps the tags they had, and a card that takes a tag off every option warns when a constraint still has rules for it. Change cards draw the change the way the editor shows the item: a wildcard edit lists the options it touches with + for new ones, removed ones struck through and old → new for text, share of the draw, tags, negative and fallback, with the untouched ones folded into a count; a change to an item's description, tags, category or rating shows old → new with the category's own chip, and category, tag and bulk cards show library chips instead of lines of text. In replies, a variable is drawn like the editors draw it (accessors in amber, `.neg` in red, and variables the run sets, like `$iteration` or `$model_family`, marked read-only), an item name the model put in backticks is a chip like any other, and a list of three or more items shows as an item list with each one's category chip.
|
||||
- **Pack builder.** In the sidebar. Describe a pack and it plans the choices and rules, asks a few questions, builds every item, tests it on 200 seeds, fixes what failed and installs it as one bundle with one Undo. It knows how each image model reads a prompt (Pony, Illustrious, Flux and more) and can plan a story over a Context Loop. Its item builds skip a local model's thinking on Auto like the Draft with AI panels, the Negatives setting now holds for every pack (Template only or None leave options without negatives), and an outfit that accepts two kinds of shoes no longer gets an empty Shoes option that left some prompts barefoot. A rule on a shared list ("each shirt in a colour from one list, colours fit the season") now runs before the items that draw from the list, so the colour in the shirt follows it; the list no longer prints a second colour at the end of the prompt, and the test checks the colour in the shirt. Fixing stops sending a problem that came back unchanged after a rebuild. The plan now holds to your request: "a hat 30% of the time" leaves the hat out in 70% of runs, "the same hero in every image" holds the hero, and an outfits pack shows the outfit, set by the code itself. A rule the request names with no rule in the plan ("winter never gets pastel colours") goes back to the planner. A plan that runs into the model's output limit is asked for once more, shorter. A rule written as prompt text ("exclude pastels") is left out instead of printed, an outfit with rules on it no longer picks two (one casual and one formal left only boots), a shared list drawn by another wildcard no longer breaks its rule every run, and the test catches a $name the prompt prints as written. A rule on a colour drawn from a shared list now reaches the drawn colour, "sneakers with casual, heels with formal, boots with either" becomes the rules when the planner wrote them wrong or left them out, a story's beats no longer describe a different hero each frame, and one option that crams a dozen heroes together becomes a dozen options, and a request for "every image of a loop" runs as a story instead of single images, so its held hero stays held. A new Plan drafts choice, When needed (now the default), drafts the plan a second time only when the code sees a problem in the first and keeps the better one, so a clean first plan costs nothing extra. Each wildcard's options are now asked for grouped by the value its rules are about (winter, summer), so every value has options from the first try instead of a second call to fill the gaps. A template that starts with "$quality $style" no longer prints both twice, and a negative that names a $variable nothing sets no longer prints it as written. A colour wildcard whose options already name their colour no longer gets a second, different colour from a shared list in front, and a list of up to 10 values gets an option for every value. The Template, Combine and Fixed values panels can no longer run on to the output limit on one long line. A plan with "Casual Outfit" and "Formal Outfit" printed both in every prompt and its shoe rules left no shoe, so the fallback was always taken; the two are now one Outfit slot with a casual and a formal kind. A rule that adds to the pick it reads ("cap" after "a person in a baseball cap") is left out, the test now sees rules keyed on a rolled tag fire instead of reporting them as never fired, and a rule whose words read a variable ("wearing a $top") is checked against the top the run picked. "A person who wears a hat 30% of the time" now leaves the hat out, not the person, even when the planner wrote the share the wrong way round or gave the hat two picks. Two rules that add words to the same thing on the same value ("at night: moody shadows" and "at night: volumetric darkness") now both apply; only the first did. A pack for Pony and Flux no longer rolls the image model or the prompt style as a pick nothing reads, and no longer prints Pony's quality words (with "1girl, solo") on every Flux image: the checkpoint decides, a fixed value can no longer write over $model_family, score tags stay on the Pony row of the quality rule (and come out of style presets and other wildcards' options), the quality rule is one if/else even when the model writes it as two (the second's "otherwise" used to write over Pony's tags), and $quality stays in the template (the duplicate check used to take it out, since the test runs load no model). An outfit wildcard named like its kinds no longer prints a bare "casual" or "formal", and a shoe a rule names ("sneakers with casual") becomes an option when the model's options still leave it out.
|
||||
- **Pack builder settings that fit the pack.** The Settings step lists the settings that fit your request, each with why: Natural phrases and no negatives for Flux, Tags for Pony, Per model family when the pack is for two models, NSFW for an explicit request, Reuse what fits when you ask for your own wildcards. **Use recommended** takes them; nothing changes until you press it. The chat's plan card recommends settings too, and its button is now **Open in Pack builder**: it fills in the description without starting the plan, so you can add reference images and check the settings first.
|
||||
- **Small local models.** A 9B model on a 16 GB card is a supported setup. The assistant fits its instructions and tools to the model and works through bigger asks one step at a time. A message that touches a feature (refs, constraints, rules, negatives and more) brings a few lines on how it works. Tool calls can only name items that exist, and edits only the ones you pointed at. Each step offers about ten tools that fit the message, and a question gets an answer instead of a card. Before it finishes, the code checks its cards against what you asked for (constraints, "only" rules, fallbacks, negatives, tag filters) and asks once for what is missing, a reply that talks about something no card has says so, a reply that claims a change it never made gets one more step with only the change tools, and a tool it keeps repeating is closed for the rest of the answer.
|
||||
|
||||
Reference in New Issue
Block a user