-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add Shap-E #3742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Shap-E #3742
Changes from 93 commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
20e5be7
refactor prior_transformer
9324a54
add
303eeb3
add
a101a17
update conversion script for renderer model
affe807
refactor camera a little bit
fca2532
clean up
f234253
style
73ce7f7
fix copies
1ad370b
Merge remote-tracking branch 'origin/main' into shap-ee
252e7a8
Update src/diffusers/schedulers/scheduling_heun_discrete.py
yiyixuxu 48adaa6
Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
yiyixuxu ba0db21
Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
yiyixuxu dfb6a2e
alpha_transform_type
514eabe
Merge branch 'shap-ee' of https://github.com/huggingface/diffusers in…
55e59d9
remove step_index argument
68ef317
remove get_sigmas_karras
6ec68ee
remove _yiyi_sigma_to_t
5b5a8e6
move the rescale prompt_embeds from prior_transformer to pipeline
3f6b435
replace baddbmm with einsum to match origial repo
dd1991b
Revert "replace baddbmm with einsum to match origial repo"
3069e8e
add step_index to scale_model_input
6bd46da
Revert "move the rescale prompt_embeds from prior_transformer to pipe…
8f9b232
move rescale from prior_transformer to pipeline
7eae66b
correct step_index in scale_model_input
ea99154
remove print lines
49eb879
refactor prior - reduce arguments
90cc68c
make style
0aac118
add prior_image
d9f9101
arg embedding_proj_norm -> norm_embedding_proj
2c84391
add pre-norm for proj_embedding
501fed7
move rescale prompt from pipeline to _encode_prompt
f970afd
add img2img pipeline
443450c
style
8e27fbc
copies
2902f10
Update src/diffusers/models/prior_transformer.py
yiyixuxu 7c5aa91
Update src/diffusers/models/prior_transformer.py
yiyixuxu 7194b86
Update src/diffusers/models/prior_transformer.py
yiyixuxu 6a460a5
Update src/diffusers/models/prior_transformer.py
yiyixuxu fc92184
Update src/diffusers/models/prior_transformer.py
yiyixuxu 6ca8e55
Update src/diffusers/models/prior_transformer.py
yiyixuxu 92d84f9
Update src/diffusers/models/prior_transformer.py
yiyixuxu b2c31f2
Update src/diffusers/models/prior_transformer.py
yiyixuxu 04160fa
Update src/diffusers/models/prior_transformer.py
yiyixuxu ece3bab
Update src/diffusers/models/prior_transformer.py
yiyixuxu 1ac3c42
finish refactor prior_tranformer
1c6d30b
make style
7348820
refactor renderer
172c2db
fix
d8bb607
make style
51d84b2
refactor img2img
30b5391
remove params_proj
0630626
add test
d92350e
add upcast_softmax to prior_transformer
2dfc351
enable num_images_per_prompt, add save_gif utility
295077a
add
2027e9b
add fast test
7ff4fcc
make style
32145b8
add slow test
c393463
style
a98094d
add test for img2img
944f8a6
refactor
d6f5011
Merge branch 'main' into shap-ee
yiyixuxu 3cac8d2
enable batching
de15046
style
e44fcb5
refactor scheduler
fb2319e
update test
9c78816
style
76c19d6
attempt to solve batch related tests timeout
f6d184b
add doc
bd49532
Merge branch 'main' into shap-ee
patrickvonplaten a4e12f4
Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
yiyixuxu f4849f5
Update src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py
yiyixuxu 19aa590
hardcode rendering related config
73438f6
update betas_for_alpha_bar on ddpm_scheduler
66dadc1
fix copies
a06ae4a
fix
b46b338
export_to_gif
29c0bba
style
6d2c204
second attempt to speed up batching tests
88db770
add doc page to index
4978d3c
Remove intermediate clipping
patrickvonplaten 3330cad
3rd attempt to speed up batching tests
bce48af
Remvoe time index
patrickvonplaten 3acaa3d
simplify scheduler
patrickvonplaten d5c1eff
Fix more
patrickvonplaten 51e04ad
Fix more
patrickvonplaten 3a489b9
Merge branch 'main' into shap-ee
patrickvonplaten 67ca56c
fix more
patrickvonplaten 78868f8
Merge branch 'shap-ee' of https://github.com/huggingface/diffusers in…
patrickvonplaten 7c4c75b
make style
patrickvonplaten a88ea4c
fix schedulers
patrickvonplaten 68f70c3
fix some more tests
patrickvonplaten ec39247
finish
patrickvonplaten 9ebf816
add one more test
patrickvonplaten 9328784
Merge branch 'shap-ee' of https://github.com/huggingface/diffusers in…
438946a
Apply suggestions from code review
yiyixuxu 698edbb
Merge branch 'shap-ee' of https://github.com/huggingface/diffusers in…
1dab075
style
c437d9c
Merge branch 'main' into shap-ee
yiyixuxu ca2b540
apply feedbacks
1dfb3f8
style
1a82d1e
fix copies
172eeeb
add one example
4171e6c
style
39e8aa8
add example for img2img
c604ab6
fix doc
2016fe0
fix more doc strings
00119be
size -> frame_size
3741673
style
fd2aa2b
update doc
4d4ad1f
style
51506bd
fix on doc
b4a92f4
update repo name
f36c668
improve the usage example in shap-e img2img
sayakpaul 82cd50e
add usage examples in the shap-e docs.
sayakpaul c271f62
consolidate examples.
sayakpaul 8c7a276
minor fix.
sayakpaul 734a589
Merge branch 'main' into shap-ee
sayakpaul c8b08ac
update doc
ce4dbd2
Apply suggestions from code review
patrickvonplaten addff79
Apply suggestions from code review
patrickvonplaten 8b97857
remove upcast
patrickvonplaten 43c6044
Merge branch 'main' of https://github.com/huggingface/diffusers into …
patrickvonplaten c0912dc
Make sure background is white
patrickvonplaten 5c609e6
Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
patrickvonplaten eb7225c
Apply suggestions from code review
patrickvonplaten 49e1123
Finish
patrickvonplaten ad5d7b1
Apply suggestions from code review
pcuenca 2bd69b6
Update src/diffusers/pipelines/shap_e/pipeline_shap_e.py
pcuenca f338eda
Make style
pcuenca 3699dde
Merge branch 'main' into shap-ee
patrickvonplaten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <!--Copyright 2023 The HuggingFace Team. All rights reserved. | ||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | ||
| an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations under the License. | ||
| --> | ||
|
|
||
| # Shap-E | ||
|
|
||
| ## Overview | ||
|
|
||
| The Shap-E model was proposed in [ Shap-E: Generating Conditional 3D Implicit Functions](https://arxiv.org/abs/2305.02463) by Alex Nichol and Heewon Jun from [OpenAI](https://github.com/openai). | ||
|
|
||
| The abstract of paper is the following: | ||
yiyixuxu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| *We present Shap-E, a conditional generative model for 3D assets. Unlike recent work on 3D generative models which produce a single output representation, Shap-E directly generates the parameters of implicit functions that can be rendered as both textured meshes and neural radiance fields. We train Shap-E in two stages: first, we train an encoder that deterministically maps 3D assets into the parameters of an implicit function; second, we train a conditional diffusion model on outputs of the encoder. When trained on a large dataset of paired 3D and text data, our resulting models are capable of generating complex and diverse 3D assets in a matter of seconds. When compared to Point-E, an explicit generative model over point clouds, Shap-E converges faster and reaches comparable or better sample quality despite modeling a higher-dimensional, multi-representation output space.* | ||
|
|
||
| The original codebase can be found [here](https://github.com/openai/shap-e) | ||
|
|
||
| ## Available Pipelines: | ||
|
|
||
| | Pipeline | Tasks | | ||
| |---|---| | ||
| | [pipeline_shap_e.py](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py) | *Text-to-Image Generation* | | ||
| | [pipeline_shap_e_img2img.py](https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py) | *Image-to-Image Generation* | | ||
patrickvonplaten marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## ShapEPipeline | ||
| [[autodoc]] ShapEPipeline | ||
| - all | ||
| - __call__ | ||
|
|
||
| [[autodoc]] ShapEImg2ImgPipeline | ||
| - all | ||
| - __call__ | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.