{"id":16778311,"url":"https://github.com/slowy07/luna","last_synced_at":"2025-03-22T00:31:06.637Z","repository":{"id":60218390,"uuid":"539457890","full_name":"slowy07/luna","owner":"slowy07","description":"text to image generation with stable diffusion","archived":false,"fork":false,"pushed_at":"2023-10-04T00:51:22.000Z","size":17150,"stargazers_count":64,"open_issues_count":1,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-18T06:23:00.797Z","etag":null,"topics":["artificial-intelligence","python","stable-diffusion","text-to-image"],"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/slowy07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"arfyslowy","open_collective":null,"ko_fi":"arfyslowy","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":"https://saweria.co/slowy07"}},"created_at":"2022-09-21T11:42:35.000Z","updated_at":"2024-09-25T14:10:56.000Z","dependencies_parsed_at":"2024-10-28T11:47:22.833Z","dependency_job_id":"26af1a52-a992-40d3-b7ab-435d8386b073","html_url":"https://github.com/slowy07/luna","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowy07%2Fluna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowy07%2Fluna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowy07%2Fluna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slowy07%2Fluna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slowy07","download_url":"https://codeload.github.com/slowy07/luna/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"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":["artificial-intelligence","python","stable-diffusion","text-to-image"],"created_at":"2024-10-13T07:27:24.029Z","updated_at":"2025-03-22T00:31:05.668Z","avatar_url":"https://github.com/slowy07.png","language":"Python","funding_links":["https://patreon.com/arfyslowy","https://ko-fi.com/arfyslowy","https://saweria.co/slowy07","https://www.buymeacoffee.com/arfyslowy"],"categories":[],"sub_categories":[],"readme":"# luna\n![luna_banner](.github/luna_banner.png)\n_\u003cp align=\"center\"\u003e This image background generated with stable diffusion luna\u003c/p\u003e_\n\n\n![code_quality_checking](https://img.shields.io/github/workflow/status/slowy07/luna/CodeQL?label=Code%20quality%20check\u0026style=flat-square)\n![python_post_processing](https://img.shields.io/github/workflow/status/slowy07/luna/PythonPostPorcessing?label=Python%20Post%20Processing\u0026style=flat-square)\n![TensorFlow](https://img.shields.io/badge/TensorFlow-%23FF6F00.svg?style=flat-square\u0026logo=TensorFlow\u0026logoColor=white)\n\n\nStable diffusion is a deep learning, text-to-image model and used to generate detailted images\nconditioned on text description, thout it can also be applied to other task such as inpainting or outpainting and \ngenerate image to image translate guide by text prompt.\n\n**try online on google colab**: \n\nluna can running on online colab notebook you can check here:\n\n- [luna](https://colab.research.google.com/drive/1IyHaYLCPLRurVs-tJJRLbCcO4kr1xlOi?usp=sharing)\n- [luna with gpu and mixed precision](https://colab.research.google.com/drive/1ydFWPt6BgPT7i4VmZcs8ttGaFu7dw-cV?usp=sharing) \n  - 15 seconds generation time per image (512 x 512) on default colab GPU without drop the quality\n\n\n**usage for online colab**:\n\n- click the connect\n\n  ![connect](.github/connect.png)\n\n- open on ``runtime`` and click run all ( ``ctrl+f9`` if using shortcut )\n  \n  ![running](.github/running.png)\n\n- online collab running luna\n\n\n\n# usage\n### use venv\n```\n//create venv\npython3 -m venv venv\n\n//activate venv\nsource venv/bin/activate\n```\n\n### clone repo\nclone on https :\n```\ngit clone https://github.com/slowy07/luna\ncd luna\npip install -r requirements.txt\n```\n\nclone on ssh :\n```\ngit clone git@github.com:slowy07/luna.git\ncd luna\npip install -r requirements.txt\n```\n\n**note** : if using mac m1 you can try installing the ``requirements_m1.txt``\n\n### run script\n```\npython text2image.py --prompt=\"example text\"\n```\nto change the output file name run using the `--output` flag\n```\npython text2image.py --prompt=\"cool picture\" --output=\"cool_pic.png\"\n```\n\n\n###  install as python package\n```\npip install git+https://github.com/slowy07/luna\n```\nand run the package using\n```python\nfrom stable_diffusion_tensorflow.stable_diffusion import StableDiffusion\n\ngenerator = StableDiffusion(img_height=512, img_width=512, jit_compose=False)\nimg = generator.generate(\n  \"DSLR photograph of an astronut riding a horse\",\n  num_steps = 50,\n  unconditional_guidance_scale = 75,\n  temperature = 1,\n  batch_size = 1,\n)\n```\n\nyou can change dimension of image by change the ``img_height`` and ``img_width``\n\n```python\ngenerator = StableDiffusion(\n  img_height = 1020 # or change 1080\n  img_height = 1080 # or change 800\n)\n```\n\n### ⚠️ NOTE ⚠️\nif pip encountered an issue, try running pip with higher privilege using `sudo`\n\n# examples\n\n| prompt | image |\n| ------ | ----- |\n| minimalist house with family, mountainous forested wild, concept art illustration | ![minimalistic_house](.github/result_output/minimalist_house_with_family_mountainous_forested_wild_concept_art_illustration.png) |\n| natural cave wall, dynamic light, mist low over ground, illustration by josan gonzales and moebius, studio muti, malika favre, rhads, makoto, clean thick line, comics style | ![natural_cave](.github/result_output/natural_cave.png) |\n| A beautiful ultradetailed anime illustration of a city street, trending on artstation | ![anime_street_ilustration](.github/result_output/anime_street_ilustration.png) |\n\n---\n\n### donate\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/arfyslowy)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslowy07%2Fluna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslowy07%2Fluna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslowy07%2Fluna/lists"}