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

Created a colab version #321

Open
JD-2006 opened this issue Feb 6, 2025 · 0 comments
Open

Created a colab version #321

JD-2006 opened this issue Feb 6, 2025 · 0 comments

Comments

@JD-2006
Copy link

JD-2006 commented Feb 6, 2025

%cd DiffSynth-Studio
!pip install -e .


!pip install cpm_kernels
!pip install gradio
!apt-get update
!apt-get install -y --no-install-recommends libgl1 libglib2.0-0
# apt-get install ffmpeg libsm6 libxext6  -y



from diffsynth import download_models

download_models(["FLUX.1-dev", "Kolors"])



from diffsynth.models.downloader import download_from_huggingface, download_from_modelscope

# From Modelscope (recommended)
download_from_modelscope("Kwai-Kolors/Kolors", "vae/diffusion_pytorch_model.fp16.bin", "models/kolors/Kolors/vae")
# From Huggingface
download_from_huggingface("Kwai-Kolors/Kolors", "vae/diffusion_pytorch_model.fp16.safetensors", "models/kolors/Kolors/vae")

# Open the file in read mode
with open('apps/gradio/DiffSynth_Studio.py', 'r') as file:
    lines = file.readlines()

# Modify the last line
if lines[-1].strip() == 'app.launch()':
    lines[-1] = 'app.launch(share=True)\n'

# Write the modified content back to the file
with open('apps/gradio/DiffSynth_Studio.py', 'w') as file:
    file.writelines(lines)

print("File updated successfully.")



!python apps/gradio/DiffSynth_Studio.py```
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

1 participant