Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Run IC-Light on Google Colab Free Tier
0xkoji
0xkoji

Posted on

     

Run IC-Light on Google Colab Free Tier

What is IC-Light?

IC-Light is a project to manipulate the illumination of images.
The name “IC-Light” stands for “Imposing Consistent Light” (we will briefly describe this at the end of this page).

GitHub logo lllyasviel / IC-Light

More relighting!

IC-Light

IC-Light is a project to manipulate the illumination of images.

The name "IC-Light" stands for"Imposing Consistent Light" (we will briefly describe this at the end of this page).

Currently, we release two types of models: text-conditioned relighting model and background-conditioned model. Both types take foreground images as inputs.

Note that "iclightai dot com" is a scam website. They have no relationship with us. Do not give scam websites money! This GitHub repo is the only official IC-Light.

News

Alternative model for stronger illumination modifications.

Some news about flux ishere. (A fixupdate is added at Nov 25, more demos will be uploaded soon.)

Get Started

Below script will run the text-conditioned relighting model:

git clone https://github.com/lllyasviel/IC-Light.gitcd IC-Lightconda create -n iclight python=3.10conda activate iclightpip install torch torchvision --index-url https://download.pytorch.org/whl/cu121pip install -r requirements.txtpython gradio_demo.py

Or, to use background-conditioned demo:

python gradio_demo_bg.py

Model…

How to Run IC-Light on Google Colab?
The steps we need are very straightforward and not difficult.

Step1. Change Runtime on Google Colab

Go tohttps://colab.research.google.com/ and click Runtime -> Change Runtime -> T4 GPU

Step2. Clone the repo

!git clone https://github.com/lllyasviel/IC-Light.git
Enter fullscreen modeExit fullscreen mode

Step3. Install dependencies

cdIC-Light!pipinstalltorch torchvision--index-url https://download.pytorch.org/whl/cu121!pipinstall-r requirements.txt
Enter fullscreen modeExit fullscreen mode

This step will take some time.

Step4. Modify gradio_demo_bg.py

We just need to change only 1 line.

before

block.launch(server_name='0.0.0.0')
Enter fullscreen modeExit fullscreen mode

after

block.launch(server_name='127.0.0.1',share=True)
Enter fullscreen modeExit fullscreen mode

Step5. Run gradio_demo_bg.py

!python gradio_demo_bg.py
Enter fullscreen modeExit fullscreen mode

You will see something like this. This step also would take some time since need to download models.

/usr/local/lib/python3.10/dist-packages/transformers/utils/generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.  _torch_pytree._register_pytree_node(The cacheformodel filesinTransformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling`transformers.utils.move_cache()`.0it[00:00, ?it/s]2024-05-11 01:08:16.363718: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factoryforplugin cuDNN when one has already been registered2024-05-11 01:08:16.363780: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factoryforplugin cuFFT when one has already been registered2024-05-11 01:08:16.493211: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factoryforplugin cuBLAS when one has already been registered2024-05-11 01:08:18.972938: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT/usr/local/lib/python3.10/dist-packages/transformers/utils/generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.  _torch_pytree._register_pytree_node(/usr/local/lib/python3.10/dist-packages/transformers/utils/generic.py:309: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.  _torch_pytree._register_pytree_node(tokenizer/tokenizer_config.json: 100% 704/704[00:00<00:00, 2.61MB/s]tokenizer/vocab.json: 100% 1.06M/1.06M[00:00<00:00, 3.22MB/s]tokenizer/merges.txt: 100% 525k/525k[00:00<00:00, 2.15MB/s]tokenizer/special_tokens_map.json: 100% 586/586[00:00<00:00, 2.40MB/s]text_encoder/config.json: 100% 560/560[00:00<00:00, 2.23MB/s]model.safetensors: 100% 246M/246M[00:01<00:00, 144MB/s]vae/config.json: 100% 606/606[00:00<00:00, 2.37MB/s]diffusion_pytorch_model.safetensors: 100% 167M/167M[00:01<00:00, 163MB/s]unet/config.json: 100% 1.78k/1.78k[00:00<00:00, 7.60MB/s]diffusion_pytorch_model.safetensors: 100% 1.72G/1.72G[00:20<00:00, 83.9MB/s]config.json: 100% 548/548[00:00<00:00, 2.31MB/s]pytorch_model.bin: 100% 177M/177M[00:02<00:00, 66.7MB/s]100% 1.60G/1.60G[00:13<00:00, 126MB/s]Running onlocalURL:  http://127.0.0.1:7860IMPORTANT: You are using gradio version 3.41.2, however version 4.29.0 is available, please upgrade.--------Running on public URL: https://65a7c6684da105a45e.gradio.live
Enter fullscreen modeExit fullscreen mode

Then you need to accessRunning on public URL.
When you access the public URL, you will see something like 👇

gradio

Enjoy IC-Light!

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Never lose curiositySoftware Engineer at a startuptypescript, javascript, react, and python.code to do something weird/helpfullearning rust as a new journey 😎#genai #mediaart #art #hardware
  • Location
    Brooklyn in the United States and Tokyo in Japan
  • Education
    New York University
  • Pronouns
    he/him/his
  • Work
    Software Engineer
  • Joined

More from0xkoji

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp