Skip to content
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

request python version of file is compatable to run on huggingface spaces gradio sdk #151

Open
bugbounted opened this issue Jan 22, 2023 · 2 comments

Comments

@bugbounted
Copy link

bugbounted commented Jan 22, 2023

Hi Nathan Raw,
please make python file compatable to run on huggingface spaces gradio sdk.
waiting for your response
finest regards

@bugbounted bugbounted changed the title request python version of file is compatable to run on huggingface gradio sdk request python version of file is compatable to run on huggingface spaces gradio sdk Jan 22, 2023
@Atomic-Germ
Copy link
Contributor

I believe the code you're looking for is in the README.MD file:

from stable_diffusion_videos import StableDiffusionWalkPipeline, Interface
import torch

pipeline = StableDiffusionWalkPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    torch_dtype=torch.float16,
    revision="fp16",
).to("cuda")

interface = Interface(pipeline)
interface.launch()

or for MacOS on an M1:

from stable_diffusion_videos import StableDiffusionWalkPipeline, Interface
import torch

pipeline = StableDiffusionWalkPipeline.from_pretrained(
    "CompVis/stable-diffusion-v1-4",
    torch_dtype=torch.float32,
    revision="fp16",
).to("mps")

interface = Interface(pipeline)
interface.launch()

This gets you:

~> python3 app.py 
Fetching 16 files: 100%|████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 17581.57it/s]
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.

and then put that http://127.0.0.1:7860 in the browser:

Screenshot 2023-01-22 at 12 16 14 PM

@nateraw
Copy link
Owner

nateraw commented Jan 26, 2023

Yea you would need to upgrade your space to have a GPU, though, which you can do in the "settings" tab of the space you created. You can see some options here below:

Screen Shot 2023-01-25 at 7 02 05 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants