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

Redirect download directory #195

Open
Jeffery-Ni opened this issue May 29, 2023 · 2 comments
Open

Redirect download directory #195

Jeffery-Ni opened this issue May 29, 2023 · 2 comments

Comments

@Jeffery-Ni
Copy link

when running the example:
from stable_diffusion_videos import StableDiffusionWalkPipeline
import torch

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

video_path = pipeline.walk(
prompts=['a cat', 'a dog'],
seeds=[42, 1337],
num_interpolation_steps=3,
height=512, # use multiples of 64 if > 512. Multiples of 8 if < 512.
width=512, # use multiples of 64 if > 512. Multiples of 8 if < 512.
output_dir='dreams', # Where images/videos will be saved
name='animals_test', # Subdirectory of output_dir where images/videos will be saved
guidance_scale=8.5, # Higher adheres to prompt more, lower lets model take the wheel
num_inference_steps=50, # Number of diffusion steps per image generated. 50 is good default
)
I want to redirect the downloading of the pre-trained data to a directory of designated directory of my wish, and possibly use that directory for the later generation, how can i accomplish that?

@yshashanky
Copy link

Which directory is it using now for downloading?

@AlanZeng423
Copy link

Like this

from pathlib import Path

# Define the directory where you want to store the model checkpoints and data
download_location = Path("/path/to/your/download/directory")

# Use the `cache_dir` parameter when loading the pre-trained models or datasets
pipe = StableDiffusionWalkPipeline.from_pretrained(
    'runwayml/stable-diffusion-v1-5',
    torch_dtype=torch.float16,
    safety_checker=None,
    vae=AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16).to("cuda"),
    scheduler=LMSDiscreteScheduler(
        beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear"
    ),
    cache_dir=download_location  # Specify the download location here
).to("cuda")

# ...

if __name__ == '__main__':
    interface.launch(debug=True)

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