Skip to content

Instantly share code, notes, and snippets.

@AK391
AK391 / colab-waifu-diffusion
Created September 8, 2022 23:09
colab for waifu diffusion
!pip install transformers gradio scipy ftfy "ipywidgets>=7,<8" datasets diffusers
import gradio as gr
import torch
from torch import autocast
from diffusers import StableDiffusionPipeline
model_id = "hakurei/waifu-diffusion"
device = "cuda"
# model: https://huggingface.co/osanseviero/BigGAN-deep-128
# HF blog: https://huggingface.co/blog/gradio-spaces
# pip install gradio before running code below
import gradio as gr
gr.Interface.load("huggingface/osanseviero/BigGAN-deep-128").launch()
# launch your own Gradio Web Demo of Arcane style transfer by following the steps below
# open a jupyter notebook, code editor (vs code etc), or google colab
# pip install gradio
# copy the code below into a file or cell in a python notebook and run it
# that's it, a web demo will appear in your python notebook or web browser
# github: https://github.com/jjeamin/anime_style_transfer_pytorch
# HF blog: https://huggingface.co/blog/gradio-spaces
import gradio as gr
# blog: https://huggingface.co/blog/gradio-spaces
# pip install gradio before running the code below
import gradio as gr
title = "New AnimeganV2"
description = "this is a test"
gr.Interface.load("spaces/akhaliq/AnimeGANv2", title=title, description=description).launch()
# blog: https://huggingface.co/blog/gradio-spaces
# It's so easy to demonstrate a Machine Learning project thanks to Gradio.
# In this blog post, we'll walk you through:
# the recent Gradio integration that helps you demo models from the Hub seamlessly with few lines of code leveraging the Inference API.
# how to use Hugging Face Spaces to host demos of your own models.
# Hugging Face Hub Integration in Gradio
# You can demonstrate your models in the Hub easily. You only need to define the Interface that includes: