{"id":13825308,"url":"https://github.com/mwydmuch/ZoomVideoComposer","last_synced_at":"2025-07-08T21:32:00.347Z","repository":{"id":177221050,"uuid":"657969669","full_name":"mwydmuch/ZoomVideoComposer","owner":"mwydmuch","description":"Pyhton script for generating zoom in/out videos from a set of images","archived":false,"fork":false,"pushed_at":"2024-01-07T16:03:43.000Z","size":7356,"stargazers_count":117,"open_issues_count":6,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-14T00:05:52.527Z","etag":null,"topics":["midjourney","python","stable-diffusion","video-generation","video-generator","zoom-in","zoom-out"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mwydmuch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-24T11:09:25.000Z","updated_at":"2025-06-03T07:50:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec916676-4fc1-4067-8eb3-e7eb9f7f5907","html_url":"https://github.com/mwydmuch/ZoomVideoComposer","commit_stats":null,"previous_names":["mwydmuch/zoomvideocomposer"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mwydmuch/ZoomVideoComposer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FZoomVideoComposer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FZoomVideoComposer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FZoomVideoComposer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FZoomVideoComposer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mwydmuch","download_url":"https://codeload.github.com/mwydmuch/ZoomVideoComposer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mwydmuch%2FZoomVideoComposer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264352782,"owners_count":23594970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["midjourney","python","stable-diffusion","video-generation","video-generator","zoom-in","zoom-out"],"created_at":"2024-08-04T09:01:18.270Z","updated_at":"2025-07-08T21:31:58.134Z","avatar_url":"https://github.com/mwydmuch.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ZoomVideoComposer\n\nThis script aims to help to create zoom out/in videos from the set of images (generated, for example, with [Midjourney 5.2+ zoom out feature](https://docs.midjourney.com/docs/zoom-out) or other AI tools like Stable Diffusion or Photoshop) in a few minutes (depending on the number of images used of course).\n\nFeatures:\n\n- The script uses a correct interpolation for zooming that doesn't cause the effect of speeding up/and slowing down, which is noticeable in some zoom videos.\n- It implements some basic image blending, so the transitions between images seem to be more smooth.\n- It allows to set video duration, resolution, frame rate, direction of zoom, and easing.\n- It can optionally add audio to the generated video.\n\nLimitations:\n\n- Currently, the zoom factor/ratio between all the images needs to be the same.\n- At the moment, the images need to be perfectly centered (Midjourney 5.2 zoom out feature from time to time shifts the image that is zoomed out, and such images might not look good in the video).\n\nI created it for myself to make experimentation with Midjourney easier for me. I might have missed some possible use cases, so if something is not working for you or you would like to have some feature, please let me know, and I will try to fix/improve it. Contributions are welcome, just open a PR.\n\n## Usage\n\nTo use the script, you need to have Python installed on your machine.\nYou can download it [here](https://www.python.org/downloads/) if you are using Windows.\nMacOS and Linux users should have Python installed by default.\n\n1. [Download this repository](https://github.com/mwydmuch/ZoomVideoComposer/archive/refs/tags/0.3.2.zip), unpack it, and open the terminal/command line window in the root of the repository.\n\n2. Install the required packages by running the following command in the terminal/cmd window:\n\n```\npip install -r requirements.txt\n```\n\n3. Save images to one folder and rename them so that their lexicographic order matches the order you want them to appear in the video. For example, if you have 10 images, name them something like `00001.png`, `00002.png`, ..., `00010.png`.\n\n4. Start the web UI by running the `gradio_ui.py` and open http://127.0.0.1:7860 in your web browser to use it.\n\nor\n\n4. Run the `zoom_video_composer.py` script providing a path to the folder with the images you want to use to create the video (you can also provide paths to each image separately in a specific order) and other options as specified below:\n\n```\nUsage: zoom_video_composer.py [OPTIONS] IMAGE_PATHS...\n\n  Compose a zoom video from multiple provided images.\n\nOptions:\n  -a, --audio-path FILE           Audio file path that will be added to the\n                                  video.\n  -z, --zoom FLOAT                Zoom factor/ratio between images.  [default:\n                                  2.0]\n  -d, --duration FLOAT            Duration of the video in seconds.  [default:\n                                  10.0]\n  -e, --easing [linear|linearWithInOutEase|easeInSine|easeOutSine|easeInOutSine|easeInQuad|easeOutQuad|easeInOutQuad|easeInCubic|easeOutCubic|easeInOutCubic|easeInPow|easeOutPow|easeInOutPow]\n                                  Easing function.  [default: easeInOutSine]\n  --easing-power FLOAT            Power argument of easeInPow, easeOutPow and\n                                  easeInOutPow easing functions.  [default:\n                                  1.5]\n  --ease-duration FLOAT           Duration of easing in linearWithInOutEase as\n                                  a fraction of video duration.  [default:\n                                  0.02]\n  -D, --direction [in|out|inout|outin]\n                                  Zoom direction. Inout and outin combine both\n                                  directions.  [default: out]\n  -f, --fps INTEGER               Frames per second of the output video.\n                                  [default: 30]\n  -w, --width FLOAT               Width of the output video. Values \u003e 1 are\n                                  interpreted as specific sizes in pixels.\n                                  Values \u003c= 1 are interpreted as a fraction of\n                                  the width of the first image.  [default: 1]\n  -h, --height FLOAT              Height of the output video. Values \u003e 1 are\n                                  interpreted as specific sizes in pixels.\n                                  Values \u003c= 1 are interpreted as a fraction of\n                                  the height of the first image.  [default: 1]\n  -s, --resampling [nearest|box|bilinear|hamming|bicubic|lanczos]\n                                  Resampling technique to use when resizing\n                                  images.  [default: lanczos]\n  -S, --super-sampling FLOAT      Scales the images by the provided factor.\n                                  Values \u003e 1 may increase the smoothness of\n                                  the animation, when using very slow zooms.\n                                  They increase the duration of the rendering.\n                                  [default: 1.0]\n  -m, --margin FLOAT              Size of the margin to cut from the edges of\n                                  each image for better blending with the\n                                  next/previous image. Values \u003e 1 are\n                                  interpreted as specific sizes in pixels.\n                                  Values \u003c= 1 are interpreted as a fraction of\n                                  the smaller size of the first image.\n                                  [default: 0.05]\n  -o, --output PATH               Output video file.  [default: output.mp4]\n  -t, --threads INTEGER           Number of threads to use to generate frames.\n                                  Use values \u003c= 0 for number of available\n                                  threads on your machine minus the provided\n                                  absolute value.  [default: -1]\n  --tmp-dir PATH                  Temporary directory to store frames.\n                                  [default: tmp]\n  --keep-frames                   Keep frames in the temporary directory.\n                                  Otherwise, it will be deleted after the\n                                  video is generated.  [default: False]\n  --skip-video-generation         Skip video generation. Useful if you only\n                                  want to generate the frames. This option\n                                  will keep the temporary directory similar to\n                                  --keep-frames flag.  [default: False]\n  --reverse-images                Reverse the order of the images.  [default:\n                                  False]\n  --image-engine [pil|cv2]        Image engine to use for image processing.\n                                  [default: cv2]\n  --resume                        Resume generation of the video.  [default:\n                                  False]\n  --blend-images-only             Stops after blending the input images.\n                                  Inspecting the blended images is useful to\n                                  detect any image-shifts or other artefacts\n                                  before generating the video.  [default:\n                                  False]\n  --help                          Show this message and exit.\n```\n\n## Example of usage\n\nRun in the root directory of the repository to generate an example video from the images in the `example` directory, a duration of 20 seconds that first zooms out and then zooms back in. The video will be saved in the `example_output.mp4` file.\n\n```\npython zoom_video_composer.py example -o example_output.mp4 -d 20 -D outin -e easeInOutSine\n```\n\nThis example takes around 3 minutes to run on my Macbook Air M2. It can be speeded up by reducing the resolution of the output video and selecting faster resampling techniques like `bilinear`. The command below takes around 30 seconds to run on my Macbook Air M2, and can be used for a preview of the video before generating the final version (it reduces resolution to 512x512, framerate to 10 fps and uses a faster resampling technique).\n\n```\npython zoom_video_composer.py example -o example_output_faster.mp4 -d 20 -D outin -e easeInOutSine -f 10 -w 512 -h 512 -s bilinear\n```\n\n## Video tutorial and Google Colab for online use online\n\n(Thanks to [u/OkRub6877](https://www.reddit.com/user/OkRub6877/))\n\nYou can watch the video tutorial on the tool [here](https://www.youtube.com/watch?v=nIJV_c-hKuw).\nAnd use it online (without installing anything on your machine) using this [Google Colab](https://colab.research.google.com/drive/1lp_GF9Q8x5ckY7yQIA9zo37g-1TUGQ1T?usp=sharing).\n\n## Tips for generating proper images with Midjourney\n\n- Always use the same zoom factor for all images.\n- Never use the vary option (`V1/2/3/4` and `Vary (Strong)/(Subtle)` buttons) on one of your images. It also changes the parts of the images generated previously, breaking the smoothness of the transition.\n- Sometimes, Midjourney slightly changes the objects' position in the center when zooming out. It's recommended to avoid that by carefully selecting the images. It can also be fixed manually before running the script. See [Fix image shift](./guides/fix_image_shift.md)\n- **`Zoom Out 1.5x` button in Midjourney is currently bugged and uses another zoom factor than `--zoom 1.5` prompt argument. To create an animation from images created with this button, use `-z 1.3333` argument for the script.**\n\n## Tips on editing the images\n\nThe script stacks images on top of each other and blends them together.\nThe most zoomed-in images are always on top of less zoomed-in images,\nso if you want to modify something on the images manually, you can do it only on the most zoomed-in image.\n\n## Tips on how to generate images with Stable Diffusion or Photoshop\n\n(Thanks to [u/ObiWanCanShowMe](https://www.reddit.com/user/ObiWanCanShowMe/))\n\n### Stable Diffusion\n\nTo create a zoom out image in Stable Diffusion, you can:\n\n1. Create an image.\n2. Outpaint to a multiplier of canvas size (e.g., 2x)\n3. Resize down to the original size.\n\nRepeat until you get the desired number of images.\n\n### Photoshop\n\nYou can also create proper images using Photoshop:\n\n1. Create an image.\n2. Resize an image to a multiplier of canvas size (e.g., 2x) and use generative fill on the empty space\n3. Resize down to the original size.\n\nRepeat until you get the desired number of images.\n\n## Animations created with ZoomVideoComposer\n\n- [Cats living in the abandoned city](https://www.reddit.com/r/midjourney/comments/14jcyqs/cats_living_in_the_abandoned_city_my_first_zoom/) (the example animation)\n- [Red diamond](https://www.youtube.com/watch?v=XT2l0MkkwrQ) (1m40)\n- [Primordial crowd](https://www.youtube.com/watch?v=A012FxOSqKY) (2m06)\n- [Concept Trailer \"A.I. Noir - Berlin City Crime Stories\"](https://www.youtube.com/watch?v=7rAQjomKSPo) (2m00)\n- [Midjourney Seamless Zoom Loop](https://www.youtube.com/shorts/WQx3tBoBhBY)\n- [Trip down the mountain](https://www.youtube.com/watch?v=bB1R0MQRAYc) (1m05)\n- [Black and white (and 3 more)](https://www.reddit.com/r/midjourney/comments/14x2l6a/zoom_out_animations_collection/)\n- [Platypus at the end of the world (and 2 more)](https://www.reddit.com/r/midjourney/comments/14yv90n/zoom_out_animations_lt35_universe_trip_down_the/)\n\nAdd your animations here by creating a pull request.\n\n## Projects using ZoomVideoComposer\n\n- [GoAPI Midjourney ZoomVideo Generator](https://huggingface.co/spaces/GoAPI/Midjourney-zoom-video-generator-GoAPI) - creates zoom video from a set of prompts using [GoAPI Midjourney API](https://www.goapi.ai/midjourney-api) to generate images.\n\n## TODOs\n\n- [ ] Implement better (more smooth) blending of images.\n- [ ] Add techniques to automatically center shifted images.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwydmuch%2FZoomVideoComposer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmwydmuch%2FZoomVideoComposer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmwydmuch%2FZoomVideoComposer/lists"}