question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Textual Inversion training notebook only takes in remote images

See original GitHub issue

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.

Twitter discussion

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
patrickvonplatencommented, Sep 13, 2022

Gently ping here to update the notebook cc @patil-suraj

0reactions
patrickvonplatencommented, Dec 19, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Textual Inversion - Hugging Face
Textual Inversion is a technique for capturing novel concepts from a small number of example images in a way that can later be...
Read more >
Got weird results, not sure if I missed a step? #35 - GitHub
I trained with over 10K steps I believe, and around 7 images. ... Textual Inversion training notebook only takes in remote images ......
Read more >
How to Fine-tune Stable Diffusion using Textual Inversion
This tutorial focuses on how to fine-tune the embedding to create personalized images based on custom styles or objects. Instead of re-training the...
Read more >
[Tutorial] "Fine Tuning" Stable Diffusion using only 5 Images ...
From the paper, 5 images are the optimal amount for textual inversion. On a single V100, training should take about two hours give...
Read more >
Teach StableDiffusion new concepts via Textual Inversion
Textual Inversion is the process of teaching an image generator a specific visual concept through the use of fine-tuning. In the diagram below, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found