Allow saving generated ControlNet previews#1364
Conversation
| } | ||
| if (user_input.Get(T2IParamTypes.ControlNetPreviewOnly, false)) | ||
| { | ||
| string controlNetInputFolder = $"inputs/_comfy{backend.Data.ID}/"; |
There was a problem hiding this comment.
Wh... what's going on here? This seems very out of place
| return `inputs/_comfy${parsedId}`; | ||
| } | ||
| } | ||
| return 'inputs'; |
There was a problem hiding this comment.
All of this function except this one line is silly. Probably something like inputs/controlnet/ is the folder to use - edit oh that's literally what you're doing anyway, you just split it across places lol
| } | ||
| genericRequest('AddImageToHistory', data, res => { | ||
| if (inputBrowserHelper.inputImageBrowser) { | ||
| inputBrowserHelper.inputImageBrowser.lightRefresh(); |
There was a problem hiding this comment.
this is redundant, I'm guessing you copied from the code in the input browser itself, but that's a special case
|
Per discord conversation, should save directly to |
|
With the recent refactor, now getting an error. Setting this back to draft while I hunt down the issue: |
| public static string FilePathToDataString(Session session, string filePath, string errorContext) | ||
| { | ||
| string root = WebServer.GetUserOutputRoot(session.User); | ||
| string root = Utilities.CombinePathWithAbsolute(Environment.CurrentDirectory, session.User.OutputDirectory); |
There was a problem hiding this comment.
Selecting from the "Select" modal would try to pull from the wrong location when generating workflow.
There was a problem hiding this comment.
very out of bounds for this PR, but valid fix for if you have AppendUserNameToOutputPath disabled
There was a problem hiding this comment.
actually yeah no, i committed this fix separately
| g.CurrentMedia.SaveOutput(g.CurrentVae, g.CurrentAudioVae, id: "9"); | ||
| if (imageNodeActual.AttachedAudio is not null) | ||
| { | ||
| g.Workflow["9"]["inputs"]["fps"] = NodePath((string)imageNodeActual.AttachedAudio.Path[0], 2); |
There was a problem hiding this comment.
Use uploaded video's FPS when saving preview, otherwise audio would often desync.
There was a problem hiding this comment.
I don't think most AttachedAudio sources have a video FPS source?? 0.o
Note that part of the point of the 'proper wg node' thing is to reduce weird path hacks like this
| if (controlnetGroup) { | ||
| let firstGroup = controlnetGroup.querySelector('.input-group'); | ||
| let buttonDiv = createDiv(`controlnet_button_preview`, null, `<button class="basic-button" onclick="controlnetShowPreview()">Preview</button>`); | ||
| let buttonDiv = createDiv(`controlnet_button_preview`, null, `<button class="basic-button" onclick="controlnetShowPreview()">Preview</button> <button class="basic-button" onclick="controlnetSavePreviewToServer()">Save to Server</button>`); |
There was a problem hiding this comment.
This probably needs a disabled or a display:none? otherwise it's a very odd button with odd behavior.
There was a problem hiding this comment.
The idea was to have it both generate the preview and save to server in one go, if the user had not clicked "Preview" beforehand.
I'll change to only appear once a preview image/video is available.
CleanShot.2026-05-02.at.13.05.55.mp4