-
Notifications
You must be signed in to change notification settings - Fork 18
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
Accelerator Fix and Local Image Load Support #10
base: main
Are you sure you want to change the base?
Conversation
finetune_instruct_pix2pix.py
Outdated
@@ -1075,7 +1081,8 @@ def collate_fn(examples): | |||
pipeline.set_progress_bar_config(disable=True) | |||
|
|||
# run inference | |||
original_image = download_image(args.val_image_url) | |||
# original_image = download_image(args.val_image_url) | |||
original_image = open_image(args.val_image_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work if you pass an image URL. It will only work if you pass an image file path that is local in nature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing a change for this one to accept both a URL or a local file path
if source.startswith('http'): | ||
# Download image from URL | ||
response = requests.get(source, stream=True) | ||
response.raise_for_status() | ||
image = PIL.Image.open(response.raw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simply use load_image()
from diffusers.utils
for this.
@@ -1075,7 +1082,7 @@ def collate_fn(examples): | |||
pipeline.set_progress_bar_config(disable=True) | |||
|
|||
# run inference | |||
original_image = download_image(args.val_image_url) | |||
load_image(args.val_image_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
load_image()
doesn't return anything and is neither a closure inside main()
so, I am sure about the effectivity of this.
Referring to issue #5