Allow output folder to be a symbolic link
diff --git a/nodes.py b/nodes.py
index 0b8be76592..d952d1c572 100644
--- a/nodes.py
+++ b/nodes.py
@@ -752,7 +752,7 @@ def map_filename(filename):
 
         full_output_folder = os.path.join(self.output_dir, subfolder)
 
-        if os.path.commonpath((self.output_dir, os.path.realpath(full_output_folder))) != self.output_dir:
+        if os.path.commonpath((self.output_dir, os.path.abspath(full_output_folder))) != self.output_dir:
             print("Saving image outside the output folder is not allowed.")
             return {}
 
diff --git a/server.py b/server.py
index 73429accaa..e4f688cf73 100644
--- a/server.py
+++ b/server.py
@@ -125,7 +125,7 @@ async def view_image(request):
                 output_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), type)
                 if "subfolder" in request.rel_url.query:
                     full_output_dir = os.path.join(output_dir, request.rel_url.query["subfolder"])
-                    if os.path.commonpath((os.path.realpath(full_output_dir), output_dir)) != output_dir:
+                    if os.path.commonpath((os.path.abspath(full_output_dir), output_dir)) != output_dir:
                         return web.Response(status=403)
                     output_dir = full_output_dir
 

The `realpath()` expands symbolic links, this PR changes it to `abspath()`, because it preserves the symbolic links, allowing the output folder to be a symbolic link pointing to a folder outside the ComfyUI folder.