Spaces:
Running
on
Zero
Running
on
Zero
fix some bugs
Browse files
Rodin.py
CHANGED
@@ -106,6 +106,7 @@ class Generator:
|
|
106 |
def preprocess(self, prompt, image_path, cache_image_base64, task_uuid=""):
|
107 |
if cache_image_base64 and prompt and task_uuid != "":
|
108 |
return prompt, cache_image_base64
|
|
|
109 |
|
110 |
image_file = open(image_path, 'rb')
|
111 |
if image_file == None:
|
@@ -127,6 +128,7 @@ class Generator:
|
|
127 |
return prompt, processed_image
|
128 |
|
129 |
def generate_mesh(self, prompt, processed_image, task_uuid=""):
|
|
|
130 |
if task_uuid == "":
|
131 |
settings = {'view_weights': [1]} # Define weights as per your requirements, for multiple images, use multiple values, e,g [0.5, 0.5]
|
132 |
images = [processed_image] # List of images, all the images should be processed first
|
@@ -152,7 +154,7 @@ class Generator:
|
|
152 |
checker.start()
|
153 |
|
154 |
preview_image = next(reversed(rodin_history(task_uuid, self.token).items()))[1]["preview_image"]
|
155 |
-
print(f"Preview image URL: {rodin_history(task_uuid, self.token)}")
|
156 |
response = requests.get(preview_image, stream=True)
|
157 |
if response.status_code == 200:
|
158 |
# 创建一个PIL Image对象
|
|
|
106 |
def preprocess(self, prompt, image_path, cache_image_base64, task_uuid=""):
|
107 |
if cache_image_base64 and prompt and task_uuid != "":
|
108 |
return prompt, cache_image_base64
|
109 |
+
print("Preprocessing image...")
|
110 |
|
111 |
image_file = open(image_path, 'rb')
|
112 |
if image_file == None:
|
|
|
128 |
return prompt, processed_image
|
129 |
|
130 |
def generate_mesh(self, prompt, processed_image, task_uuid=""):
|
131 |
+
print("Generating mesh...")
|
132 |
if task_uuid == "":
|
133 |
settings = {'view_weights': [1]} # Define weights as per your requirements, for multiple images, use multiple values, e,g [0.5, 0.5]
|
134 |
images = [processed_image] # List of images, all the images should be processed first
|
|
|
154 |
checker.start()
|
155 |
|
156 |
preview_image = next(reversed(rodin_history(task_uuid, self.token).items()))[1]["preview_image"]
|
157 |
+
# print(f"Preview image URL: {rodin_history(task_uuid, self.token)}")
|
158 |
response = requests.get(preview_image, stream=True)
|
159 |
if response.status_code == 200:
|
160 |
# 创建一个PIL Image对象
|
app.py
CHANGED
@@ -152,7 +152,7 @@ with gr.Blocks() as demo:
|
|
152 |
cache_raw_image = gr.Image(visible=False, type="pil")
|
153 |
cache_image_base64 = gr.Text(visible=False)
|
154 |
cacha_empty = gr.Text(visible=False)
|
155 |
-
cache_task_uuid = gr.Text(value="")
|
156 |
|
157 |
# button_generate.click(fn=return_render, inputs=[block_image], outputs=[raw_image, fake3d])
|
158 |
block_image.change(
|
|
|
152 |
cache_raw_image = gr.Image(visible=False, type="pil")
|
153 |
cache_image_base64 = gr.Text(visible=False)
|
154 |
cacha_empty = gr.Text(visible=False)
|
155 |
+
cache_task_uuid = gr.Text(value="", visible=False)
|
156 |
|
157 |
# button_generate.click(fn=return_render, inputs=[block_image], outputs=[raw_image, fake3d])
|
158 |
block_image.change(
|