# How can I force the Compositor to update via Python?

While working on an Add-on that does node connection stuff, I came across a problem I can not find a solution to anywhere: The compositor nodes are only ever updated / evaluated, as long as there is a compositor space open somewhere. If you for instance have the image editor maximized, compositor node tree changes are not evaluated at all.

I am displaying the result of my Python node reconnections through the Viewer Node in the image editor. As long as somewhere there is a Compositor window open, this works. As soon as you switch that window to something else (like a 3D View), updates are not calculated at all.

here is a .blend file to test this, the GIF below shows how to trigger the behavior I described:

I have tried calling the update, update_tag and evaluated_get methods pretty much anywhere I can think of. Is there a way still to force a refresh?

Compositing output can be updated by rendering without any Render Layers nodes in the compositing node tree.

bpy.ops.render.render(animation=False, write_still=False, use_viewport=False, layer="", scene="")

If I am not mistaken this use_viewport parameter seems to be for controlling if the render process is shown in the UI. It is false by default so it should not show the render in the UI unless specified otherwise.