DiffSynth-Studio icon indicating copy to clipboard operation
DiffSynth-Studio copied to clipboard

Created a colab version

Open JD-2006 opened this issue 1 year ago • 0 comments

%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```

JD-2006 avatar Feb 06 '25 14:02 JD-2006