Skip to main content
Use any model

 

Hey, AI wizards!

Today, we're troubleshooting a common issue when running AI image or video apps on platforms like Colab, Kaggle, or Sagemaker Studio Lab. Ever found yourself unable to download that coveted model because it's only available to signed-in users? Yeah, we've all been there. Especially with platforms like CivitAI or Tensor Art, attempting a download without signing in usually leads to a frustrating dead-end page.

But worry not, because I've got a couple of tricks up my sleeve for you.

Quick Hack #1: Bypassing Sign-In Walls

So, here's the first quick hack: It's a simple workaround that currently works on CivitAI and Tensor Art, and it's compatible with Chrome and Firefox. In your browser, sign in and initiate the download. Quickly pause it, click on Downloads, select "Show More," and right-click on the model to copy the download address. Now, paste this URL into your Jupyter notebook's appropriate command to successfully download the model. For a test run, we'll use the Fooocus Kaggle notebook, changing the link and name in the Download Model code block. Remember, this link has a short lifespan, but it's ample for grabbing the model.

Copy the download linkPaste the link to your Kaggle notebook

 

Option #2: File Browser Web UI

Another option for adding models involves running a file browser web UI. Great if you have the model on your local disk and want to upload it. We've got a notebook that installs a file manager. Copy and paste these two code blocks into your existing notebook, and voila! You can now install and start the file browser, perform various file operations, and crucially, upload models. 

Drag and drop a model to the Web UI

 

With your model in hand, stop the file browser and dive into your generative AI adventures.

Dealing with Interruptions and Storage Hiccups

If your download gets interrupted, whether in the file browser or during a notebook download step, no worries. Delete the corrupted model from the file browser and re-download. Always check the file size to ensure it matches the full model size; an incomplete model won't cut it for image generation.

Running out of persistent storage? Fear not. Download the model to temporary storage in the /kaggle/temp folder using the file browser. Trick your apps into using the temp model by creating a shortcut with the "ln -s" command in your notebook. This keeps your permanent storage clutter-free, and using a temporary checkpoint won't leave any broken shortcuts behind. If you downloaded another model type, you can delete the shortcut manually from the File Browser.

Create a shortcut to the temporary model

 

I hope this article streamlines your model and file management on Kaggle! Keep imagining, generating, and sharing your awesome artwork. Until next time, wizards!