Textual Inversion training notebook only takes in remote images
The Textual Inversion training notebook in Google Colab only takes in remote images, instead of also being able to take in local images either uploaded from the desktop or linked from Google Drive, both of which are more common workflows.
urls = [
"https://huggingface.co/datasets/valhalla/images/resolve/main/2.jpeg",
"https://huggingface.co/datasets/valhalla/images/resolve/main/3.jpeg",
"https://huggingface.co/datasets/valhalla/images/resolve/main/5.jpeg",
"https://huggingface.co/datasets/valhalla/images/resolve/main/6.jpeg",
## You can add additional images here
]
import requests
import glob
from io import BytesIO
def download_image(url):
try:
response = requests.get(url)
except:
return None
return Image.open(BytesIO(response.content)).convert("RGB")
images = list(filter(None,[download_image(url) for url in urls]))
The inputs to the image cell should be able to take in both remote or local images depending on if an external URL is detected.
+1 - think this feature would make a lot of sense. cc @patil-suraj :-)
Makes sense! Will update the notebooks
Gently ping here to update the notebook cc @patil-suraj
Makes sense! Will update the notebooks
Can You guys open up vector numbers so we can change them ? I got much better results with 2 and still great editability https://github.com/rinongal/textual_inversion/issues/35
Also i agree on file selector cause now giving it our own images is a PITA
Ping @patil-suraj here again :-)
@patil-suraj
Ping again @patil-suraj @williamberman @pcuenca
cc @patil-suraj
Just updated the colab to allow load images from the local directory or from drive path. https://github.com/huggingface/notebooks/blob/main/diffusers/sd_textual_inversion_training.ipynb
Closing this issue now.