s0md3v / sd-webui-roop

roop extension for StableDiffusion web-ui
GNU Affero General Public License v3.0
3.4k stars 880 forks source link

problem: "Face Editor" and "Roop" execution order #164

Open coollofty opened 1 year ago

coollofty commented 1 year ago

When both plugins are installed and enabled, the roop will execute before the face editor, which will cause the processed image of the roop to be processed again by the face editor. This order is incorrect. How to adjust it so that the roop execution order is always at the end of all plugins?

glucauze commented 1 year ago

Face editor seems to be specifically designed to do that exactly :

    if p.scripts is not None and hasattr(p.scripts, "alwayson_scripts"):
        script_index = shared.opts.data.get("face_editor_script_index", 99)
        for i, e in enumerate(p.scripts.alwayson_scripts):
            if e == self:
                p.scripts.alwayson_scripts.insert(script_index, p.scripts.alwayson_scripts.pop(i))
                break

adetailer works before roop if you want something similar