Sergiu 9 hónapja
szülő
commit
964b9b070c

BIN
03_blender/sd_blender/__pycache__/__init__.cpython-310.pyc


+ 9 - 9
03_blender/sd_blender/sample_scene/scene_info.json

@@ -14,9 +14,9 @@
               0
             ],
             "rotation": [
-              9.0,
-              26.1,
-              -15.7
+              -8,
+              -6.9,
+              -42
             ],
             "scale": [
               1,
@@ -129,13 +129,13 @@
           "transform": {
             "position": [
               0.432918,
-              -0.165131,
-              -0.080359
+              -0.202823,
+              0.08365
             ],
             "rotation": [
-              105.303,
-              0.786264,
-              69.833
+              88.8032,
+              0.786282,
+              66.6831
             ]
           },
           "lens": {
@@ -168,6 +168,6 @@
       }
     }
   },
-  "user_id": "test_user",
+  "user_id": "1125441",
   "project_id": "15a314a1-8ba1-4e0e-ad0c-f605b06f89f8"
 }

+ 2 - 1
04_stable_diffusion/ai_scene_info.json

@@ -14,5 +14,6 @@
     },
     "project_id": "15a314a1-8ba1-4e0e-ad0c-f605b06f89f8",
     "user_id": "1125441",
-    "rendered_image_id": "00bb64d51647486392fabc361ec69b7d"
+    "rendered_image_id": "00bb64d51647486392fabc361ec69b7d",
+    "image_id": "00bb64d516"
 }

+ 9 - 20
04_stable_diffusion/sd_comfy_api_v2.py

@@ -64,7 +64,7 @@ def find_image_and_convert_to_base64(image_path):
         return image_base64
 
 def upload_image_to_anvil(row_id, image_base64):
-    url = "{}/tasks/ai-image/upload-image".format(api_path)
+    url = "{}/test-3".format(api_path)
     payload = {"row_id": row_id, "image_base64": image_base64}
     response = requests.post(url, json=payload)
     if response.status_code == 200:
@@ -216,9 +216,8 @@ def get_images(ws, prompt):
 
 def main(*args):
 
-    deadlinePlugin = args[0]
-    job = deadlinePlugin.GetJob()
-    row_id = job.JobExtraInfo0
+    
+    
 
     argv = sys.argv
 
@@ -228,6 +227,8 @@ def main(*args):
 
         ai_scene_info = convert_base64_string_to_object(argv[0])
 
+        row_id = ai_scene_info["image_id"]
+
         print("loading scene data", ai_scene_info)
 
     except Exception as e:
@@ -255,28 +256,16 @@ def main(*args):
 
                 project_id = data["project_id"]
 
+                complete_image_path = image_path + "{}/{}".format(project_id,image_info['filename'])
+                print(complete_image_path)
+
                 image_base64 = find_image_and_convert_to_base64(
                     image_path + "{}/{}".format(project_id,image_info['filename'])
     )
                 upload_image_to_anvil(row_id, image_base64)
                 
-            
-
-
-            
-            
-
-    
-
-    #Commented out code to display the output images:
-
-    # for node_id in images:
-    #     for image_data in images[node_id]:
-            
-    #         image = Image.open(io.BytesIO(image_data))
-    #         image.show()
 
 if __name__ == "__main__":
-    main()
+    main(sys.argv)