Spaces:
Runtime error
Runtime error
apps/examples/ghost-eating-burger.webp
DELETED
Binary file (60.4 kB)
|
|
apps/examples/pikachu.webp
DELETED
Binary file (28.3 kB)
|
|
apps/third_party/CRM/imagedream/ldm/modules/attention.py
CHANGED
@@ -166,7 +166,7 @@ class MemoryEfficientCrossAttention(nn.Module):
|
|
166 |
self.to_out = nn.Sequential(
|
167 |
nn.Linear(inner_dim, query_dim), nn.Dropout(dropout)
|
168 |
)
|
169 |
-
self.attention_op
|
170 |
|
171 |
def forward(self, x, context=None, mask=None):
|
172 |
q = self.to_q(x)
|
|
|
166 |
self.to_out = nn.Sequential(
|
167 |
nn.Linear(inner_dim, query_dim), nn.Dropout(dropout)
|
168 |
)
|
169 |
+
self.attention_op = None
|
170 |
|
171 |
def forward(self, x, context=None, mask=None):
|
172 |
q = self.to_q(x)
|
apps/third_party/CRM/imagedream/ldm/modules/diffusionmodules/model.py
CHANGED
@@ -217,7 +217,7 @@ class MemoryEfficientAttnBlock(nn.Module):
|
|
217 |
self.proj_out = torch.nn.Conv2d(
|
218 |
in_channels, in_channels, kernel_size=1, stride=1, padding=0
|
219 |
)
|
220 |
-
self.attention_op
|
221 |
|
222 |
def forward(self, x):
|
223 |
h_ = x
|
|
|
217 |
self.proj_out = torch.nn.Conv2d(
|
218 |
in_channels, in_channels, kernel_size=1, stride=1, padding=0
|
219 |
)
|
220 |
+
self.attention_op = None
|
221 |
|
222 |
def forward(self, x):
|
223 |
h_ = x
|
gradio_app.py
CHANGED
@@ -38,7 +38,7 @@ By mimicking the artist/craftsman modeling workflow, we propose CraftsMan (aka
|
|
38 |
then a multi-view normal enhanced image generation model is used to refine the mesh.
|
39 |
We provide the coarse 3D diffusion part here.
|
40 |
<br>
|
41 |
-
If you found
|
42 |
<a style="display:inline-block; margin-left: .5em" href='https://github.com/wyysf-98/CraftsMan/'><img src='https://img.shields.io/github/stars/wyysf-98/CraftsMan?style=social' /></a>
|
43 |
<br>
|
44 |
*please note that the model is fliped due to the gradio viewer, please download the obj file and you will get the correct mesh.
|
@@ -81,6 +81,8 @@ def gen_mvimg(
|
|
81 |
mvimg_model, text, image, crop_size, seed, guidance_scale, step
|
82 |
):
|
83 |
global crm_pipeline
|
|
|
|
|
84 |
crm_pipeline.set_seed(seed)
|
85 |
rt_dict = crm_pipeline(image, scale=guidance_scale, step=step)
|
86 |
mv_imgs = rt_dict["stage1_images"]
|
@@ -206,7 +208,7 @@ if __name__=="__main__":
|
|
206 |
with gr.Row():
|
207 |
gr.Markdown('''Try a different <b>seed</b> if the result is unsatisfying. Good Luck :)''')
|
208 |
with gr.Row():
|
209 |
-
seed = gr.Number(
|
210 |
more = gr.CheckboxGroup(["Remesh", "Symmetry(TBD)"], label="More", show_label=False)
|
211 |
# remesh = gr.Checkbox(value=False, label='Remesh')
|
212 |
# symmetry = gr.Checkbox(value=False, label='Symmetry(TBD)', interactive=False)
|
@@ -256,15 +258,16 @@ if __name__=="__main__":
|
|
256 |
background_choice = gr.Dropdown(label="Backgroud Choice", value="Auto Remove Background",choices=list(background_choice.keys()))
|
257 |
rmbg_type = gr.Dropdown(label="Backgroud Remove Type", value="rembg",choices=['sam', "rembg"])
|
258 |
backgroud_color = gr.ColorPicker(label="Background Color", value="#FFFFFF", interactive=True)
|
|
|
259 |
|
260 |
with gr.Row():
|
261 |
mvimg_guidance_scale = gr.Number(value=3.5, minimum=3, maximum=10, label="2D Guidance Scale")
|
262 |
-
mvimg_steps = gr.Number(value=30, minimum=20, maximum=100, label="2D Sample Steps"
|
263 |
|
264 |
with gr.Accordion('Advanced options (3D)', open=False):
|
265 |
with gr.Row():
|
266 |
guidance_scale = gr.Number(label="3D Guidance Scale", value=7.5, minimum=3.0, maximum=10.0)
|
267 |
-
steps = gr.Number(value=50, minimum=20, maximum=100, label="3D Sample Steps"
|
268 |
|
269 |
with gr.Row():
|
270 |
scheduler = gr.Dropdown(label="scheluder", value="DDIMScheduler",choices=list(scheluder_dict.keys()))
|
|
|
38 |
then a multi-view normal enhanced image generation model is used to refine the mesh.
|
39 |
We provide the coarse 3D diffusion part here.
|
40 |
<br>
|
41 |
+
If you found CraftsMan is helpful, please help to ⭐ the <a href='https://github.com/wyysf-98/CraftsMan/' target='_blank'>Github Repo</a>. Thanks!
|
42 |
<a style="display:inline-block; margin-left: .5em" href='https://github.com/wyysf-98/CraftsMan/'><img src='https://img.shields.io/github/stars/wyysf-98/CraftsMan?style=social' /></a>
|
43 |
<br>
|
44 |
*please note that the model is fliped due to the gradio viewer, please download the obj file and you will get the correct mesh.
|
|
|
81 |
mvimg_model, text, image, crop_size, seed, guidance_scale, step
|
82 |
):
|
83 |
global crm_pipeline
|
84 |
+
if seed == 0:
|
85 |
+
seed = np.random.randint(1, 65535)
|
86 |
crm_pipeline.set_seed(seed)
|
87 |
rt_dict = crm_pipeline(image, scale=guidance_scale, step=step)
|
88 |
mv_imgs = rt_dict["stage1_images"]
|
|
|
208 |
with gr.Row():
|
209 |
gr.Markdown('''Try a different <b>seed</b> if the result is unsatisfying. Good Luck :)''')
|
210 |
with gr.Row():
|
211 |
+
seed = gr.Number(0, label='Seed', show_label=True)
|
212 |
more = gr.CheckboxGroup(["Remesh", "Symmetry(TBD)"], label="More", show_label=False)
|
213 |
# remesh = gr.Checkbox(value=False, label='Remesh')
|
214 |
# symmetry = gr.Checkbox(value=False, label='Symmetry(TBD)', interactive=False)
|
|
|
258 |
background_choice = gr.Dropdown(label="Backgroud Choice", value="Auto Remove Background",choices=list(background_choice.keys()))
|
259 |
rmbg_type = gr.Dropdown(label="Backgroud Remove Type", value="rembg",choices=['sam', "rembg"])
|
260 |
backgroud_color = gr.ColorPicker(label="Background Color", value="#FFFFFF", interactive=True)
|
261 |
+
# backgroud_color = gr.ColorPicker(label="Background Color", value="#7F7F7F", interactive=True)
|
262 |
|
263 |
with gr.Row():
|
264 |
mvimg_guidance_scale = gr.Number(value=3.5, minimum=3, maximum=10, label="2D Guidance Scale")
|
265 |
+
mvimg_steps = gr.Number(value=30, minimum=20, maximum=100, label="2D Sample Steps")
|
266 |
|
267 |
with gr.Accordion('Advanced options (3D)', open=False):
|
268 |
with gr.Row():
|
269 |
guidance_scale = gr.Number(label="3D Guidance Scale", value=7.5, minimum=3.0, maximum=10.0)
|
270 |
+
steps = gr.Number(value=50, minimum=20, maximum=100, label="3D Sample Steps")
|
271 |
|
272 |
with gr.Row():
|
273 |
scheduler = gr.Dropdown(label="scheluder", value="DDIMScheduler",choices=list(scheluder_dict.keys()))
|