ermongroup / sdedit Goto Github PK
View Code? Open in Web Editor NEWPyTorch implementation for SDEdit: Image Synthesis and Editing with Stochastic Differential Equations
Home Page: https://sde-image-editing.github.io/
License: MIT License
PyTorch implementation for SDEdit: Image Synthesis and Editing with Stochastic Differential Equations
Home Page: https://sde-image-editing.github.io/
License: MIT License
Hi there, thank you for releasing the code!
I tried several ways as below to change the step length (delta t) and the total denosing steps but none of them works:
num_timesteps
hyperparameter in the config file and changing thetotal_noise_levels
accordingly.i
in the SDEditing
demonstration functionIt seems the synthesized images remain noised after the hyperparameters are tuned. Is there a way to modify N safely? Or is it possible to accelerate the generation process by other means?
Thank you!
File "/home/dell/anaconda3/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
I get the following error when I try to generate results, can you let me know what is the reason for it? Is it due to not having the right link for pre trained model?
Thanks for your great work! Would you have some plan to release the code of the human-stroke-simulation algorithm in Appendix D.2? Thanks a lot.
Hi! I'm very impressed with the results on the project webpage. When are you going to release the paper itself?
The following error occurs in the colab demo:
Downloading: "https://image-editing-test-12345.s3-us-west-2.amazonaws.com/checkpoints/church_outdoor.ckpt" to /root/.cache/torch/hub/checkpoints/church_outdoor.ckpt
HTTPError Traceback (most recent call last)
in <cell line: 5>()
3 data_name = "lsun_church"
4 sample_step = 3
----> 5 model, betas, num_timesteps, logvar = load_model(dataset, category, "church.yml")
6 total_noise_levels = 500
7 SDEditing(betas, logvar, model, data_name, sample_step, total_noise_levels, n=3)8 frames
/usr/lib/python3.10/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
641 class HTTPDefaultErrorHandler(BaseHandler):
642 def http_error_default(self, req, fp, code, msg, hdrs):
--> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
644
645 class HTTPRedirectHandler(BaseHandler):HTTPError: HTTP Error 403: Forbidden
Hey @chenlin9 and @junyanz,
Awesome work! I have a question about training and generating high-resolution images (1024x1024).
How can I train on FFHQ or CelebA-HQ. I have looked for the config file but couldn't find any config for training 1024x1024 resolution. All the config files are for images with sizes 256x256. I would like to train the model on my custom dataset to generate 1024x1024 images. Would it be possible to provide the config file for CelebA-HQ or can you elaborate on how can I train for such a dataset to generate 1024x1024?
Thanks!
Thanks a lot for your nice work!
How do i train celeba_hq.ckpt with my own dataset?
Really cool project!! What is the license the code is released? Could you include it in the repo?
Thanks for your share of wonderful experiments.
I'm currently testing on re-generate of experiments on paper,
everything goes well, but I can't find image compositing on our distribution,
Is there any ways to do that?
Thanks for sharing the implementtion.
Just want to ask how do you prepare the input images?
# [mask, img] = torch.load("colab_demo/{}.pth".format(name))
Since "colab_demo" url is out of date, I prepare a single image and draw a mask, and read by PIL.Image.
However, it has err when run into this line: tvu.save_image(x0, os.path.join(self.args.image_folder, f'original_input.png'))
I am wondering what is correct shape of x0?
Or how do you prepare these .pth files?
torch.hub.download_url_to_file('https://image-editing-test-12345.s3-us-west-2.amazonaws.com/colab_examples/lsun_church.pth', os.path.join(path, 'lsun_church.pth'))
It should be very easy to prepare them, I guess.
Thank you for your work, and I look forward to your response.
All 3 blocks for image generation produce this error:
TypeError: image_editing_denoising_step_flexible_mask() got an unexpected keyword argument 'return_pred_xstart'
Hi, we cannot download the lsun_bedroom1.pth
using the official command python main.py --exp ./runs/ --config bedroom.yml --sample -i images --npy_name lsun_bedroom1 --sample_step 3 --t 500 --ni
. How could we fix this error? The traceback is posted below.
Thank you very much.
File "main.py", line 104, in main
runner.image_editing_sample()
File "/mnt/zff/code/diffusion_model/sdedit/sdedit/runners/image_editing.py", line 113, in image_editing_sample
download_process_data(path="colab_demo")
File "/mnt/zff/code/diffusion_model/sdedit/sdedit/functions/process_data.py", line 8, in download_process_data
torch.hub.download_url_to_file('https://image-editing-test-12345.s3-us-west-2.amazonaws.com/colab_examples/lsun_bedroom1.pth', os.path.join(path, 'lsun_bedroom1.pth'))
File "/miniconda3/envs/t1/lib/python3.8/site-packages/torch/hub.py", line 611, in download_url_to_file
u = urlopen(req)
File "/miniconda3/envs/t1/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/miniconda3/envs/t1/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/miniconda3/envs/t1/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/miniconda3/envs/t1/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/miniconda3/envs/t1/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/miniconda3/envs/t1/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
It seems that the url for processed data is no longer usable:
ERROR - main.py - 2023-12-11 10:45:23,843 - Traceback (most recent call last):
File "/home/chenqm/projects/cross-domain-trajectory-editing-private/SDEdit/main.py", line 104, in main
runner.image_editing_sample()
File "/home/chenqm/projects/cross-domain-trajectory-editing-private/SDEdit/runners/image_editing.py", line 102, in image_editing_sample
download_process_data(path="colab_demo")
File "/home/chenqm/projects/cross-domain-trajectory-editing-private/SDEdit/functions/process_data.py", line 8, in download_process_data
torch.hub.download_url_to_file('https://image-editing-test-12345.s3-us-west-2.amazonaws.com/colab_examples/lsun_bedroom1.pth', os.path.join(path, 'lsun_bedroom1.pth'))
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/site-packages/torch/hub.py", line 621, in download_url_to_file
u = urlopen(req)
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/urllib/request.py", line 523, in open
response = meth(req, response)
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/urllib/request.py", line 632, in http_response
response = self.parent.error(
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/urllib/request.py", line 561, in error
return self._call_chain(*args)
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/home/chenqm/anaconda3/envs/jax_diffuser/lib/python3.9/urllib/request.py", line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
I could not find for CelebA-HQ in https://github.com/ermongroup/SDEdit/blob/main/functions/process_data.py
@junyanz
May I ask how to achieve image compositing with this code
Hi @chenlin9
Great work, but seems that all pretrained checkpoints are down, since all rely on AWS, i.e.:
https://image-editing-test-12345.s3-us-west-2.amazonaws.com/checkpoints/bedroom.ckpt
Several works depend on these, would you mind uploading them again?
Personally, I'm looking for LSUN Bedrooms, but I see a lot of people requesting CelebA-HQ too.
Thanks.
How to re-train a model with VP-SDE?
@willieneis @junyanz @yang-song @jiamings @KellyYutongHe
Hi, thanks for your greate works
I have re-trained the model from ddim on lsun dataset, and the ckpt has saved on 95000.pth. However, when i use this ckpt in image_editing.py, i do not get some satisfied samples?
Can you help me?
@chenlin9 @yang-song @willieneis @junyanz @jiamings @KellyYutongHe
HI @chenlin9
First of all, congratulations on such a fantastic project. I had a doubt regarding the training models. As I understood, you employed a trained SDE model to perturb the target image into a noise image, and after that, you reverse the stochastic process to get the final image. In that case, we should use the repository of @yang-song https://github.com/yang-song/score_sde (this one for PyTorch implementation) to train SDE models instead of https://github.com/ermongroup/ddim right?
Thank you so much.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.