adetailer-hires-sync: hires fix and ADetailer in one click

adetailer-hires-sync is a small extension for Forge and reForge. It turns ADetailer on when you upscale a finished image with the ✨ button, and turns it off again when the upscale is done. This guide explains why that's useful and how to work with it.
The problem it solves
ADetailer adds an inpaint pass to every image. While you're still looking for a good composition, that pass is wasted time, so most people keep ADetailer off and generate at base resolution.
Then you find an image you like and click ✨ to run hires fix on it. Now you do want ADetailer, because faces and small details should be fixed at the final resolution. So you tick the ADetailer box, click ✨, wait, and untick it again. Forget the first step and you get an upscale with an unfixed face. Forget the last and every draft after that is slow.
The extension does both steps for you.
What happens when you click ✨
You click ✨ on a finished image.
If ADetailer is off, the extension switches it on and remembers that it did.
The hires pass runs, followed by ADetailer.
When generation finishes, ADetailer goes back off.
If you had ADetailer on yourself before clicking ✨, the extension leaves it alone and doesn't turn it off afterwards.
Left: the draft at base resolution. Right: the same seed after hires fix and ADetailer. Bottom row: the face area enlarged.
Upscaling several images from a batch
After a batch, each thumbnail in the txt2img gallery gets a small round checkbox. Tick the images you want to keep and click ✨ once. The extension works through them one by one: it selects a thumbnail, enables ADetailer if needed, runs the upscale, waits for it to finish, and moves to the next.
If nothing is ticked, ✨ behaves as usual and upscales the image that's currently selected.
This is the part that saves the most time. Generate a batch of drafts, tick the two or three keepers, click once and go do something else.
It also fixes wildcard prompts
There's a second problem with ✨ that shows up if you use wildcards. The stock ✨ button re-reads the prompt box. If the prompt contains a wildcard, the upscale can resolve it to something different from what the draft used, and you get an upscaled image that doesn't match the one you picked.
adetailer-hires-sync makes the second pass use the exact prompt, negative prompt and seed that the selected image was generated with. ADetailer inherits the same prompt when its own prompt field is empty. That makes ✨ safe to use with Style Grid wildcards such as {sg:lighting}.
Installing
Open Extensions, then Install from URL.
Paste
https://github.com/KazeKaze93/adetailer-hires-sync.gitand click Install.Click Apply and restart UI.
You need ADetailer installed and set up the way you like it. The extension doesn't change any ADetailer settings. It only flips the enable checkbox.
It was tested on reForge. It works on the txt2img tab.
A workflow built around it
Keep Hires fix and ADetailer unticked.
Generate drafts in batches at base resolution. They're fast.
Tick the ones worth keeping.
Click ✨. Each ticked image gets hires fix and ADetailer.
Go back to drafting. ADetailer is already off again.
The hires settings used by ✨ are the ones in your Hires fix section (upscaler, scale, denoise, steps), so set those once.
If it doesn't trigger
The extension finds the buttons by their IDs in the page. If your build of the WebUI names them differently, nothing happens when you click ✨. The README on GitHub has four one-line checks you can paste into the browser console to see which element is missing.
Links
More guides are on my profile.