Composite results in preview window?

Is there a way to create a preview window in a panel/popup and show the “Render Result”? Would like to show updates when changes made in the compositor.

Perhaps you can try this.

Won’t work for what I’m trying.

This works ,but has to many issues.

1: Render and save each time a change is made
2: Load as a icon
3: Use col.template_icon(icon_value=my_icon, scale=20) to create preview

Issues
1: Delay when changes are made and “preview” is not real time
2: Preview resolution is low

Perhaps it might be the only option to create your own rendering routine.
See template: operator_modal_draw.py

@const

Any idea why the “preview” is one step behind? Here’s kinda what I’m doing for the settings update.

def update_setting_1(self, context):        
                
    if self.setting_1:
        node.inputs[1].default_value = self.setting_1
        bpy.data.images["Render Result"].save_render(my_filepath)

You have to adjust the setting twice for the “preview” to be updated. It’s like the Render Result saves before compositing completed and not after. Is there a way to check compositing status?

I remember something like happening in my scripts most of the times I was fiddling with animation drivers etc or modal operators.

From what I understand is something about the ‘dependency graph’. You change a property but you don’t see the result (eg: the X position). Then you do some extra operation ontop (eg: change relative position to 0,0,0 which means object stays in the same place). Though the operator forces an update to synchronize the view (GUI) context with the data context (bpy.context…).

In this case there should be some operator that can be called on top of this in the image, that is no destructive.

It seems that also another really good technique to force context update is by using a property callback. As for example you can create a dummy property and assign it nonsense, but once it forces a context update you hit two birds with a stone. It might work…
https://docs.blender.org/api/current/bpy.props.html