file_name stringlengths 3 119 | file_path stringlengths 14 224 | content stringlengths 24 9.96M | language stringclasses 1
value | repo_stars int64 60 139k |
|---|---|---|---|---|
webui.py | AUTOMATIC1111_stable-diffusion-webui/webui.py | from __future__ import annotations
import os
import time
from modules import timer
from modules import initialize_util
from modules import initialize
startup_timer = timer.startup_timer
startup_timer.record("launcher")
initialize.imports()
initialize.check_versions()
def create_api(app):
fr... | Python | 139,088 |
launch.py | AUTOMATIC1111_stable-diffusion-webui/launch.py | from modules import launch_utils
args = launch_utils.args
python = launch_utils.python
git = launch_utils.git
index_url = launch_utils.index_url
dir_repos = launch_utils.dir_repos
commit_hash = launch_utils.commit_hash
git_tag = launch_utils.git_tag
run = launch_utils.run
is_installed = launch_utils.is_i... | Python | 139,088 |
test_img2img.py | AUTOMATIC1111_stable-diffusion-webui/test/test_img2img.py |
import pytest
import requests
@pytest.fixture()
def url_img2img(base_url):
return f"{base_url}/sdapi/v1/img2img"
@pytest.fixture()
def simple_img2img_request(img2img_basic_image_base64):
return {
"batch_size": 1,
"cfg_scale": 7,
"denoising_strength": 0.75,
"eta": 0,
... | Python | 139,088 |
conftest.py | AUTOMATIC1111_stable-diffusion-webui/test/conftest.py | import base64
import os
import pytest
test_files_path = os.path.dirname(__file__) + "/test_files"
test_outputs_path = os.path.dirname(__file__) + "/test_outputs"
def pytest_configure(config):
# We don't want to fail on Py.test command line arguments being
# parsed by webui:
os.environ.setdefault("IGNORE... | Python | 139,088 |
test_txt2img.py | AUTOMATIC1111_stable-diffusion-webui/test/test_txt2img.py |
import pytest
import requests
@pytest.fixture()
def url_txt2img(base_url):
return f"{base_url}/sdapi/v1/txt2img"
@pytest.fixture()
def simple_txt2img_request():
return {
"batch_size": 1,
"cfg_scale": 7,
"denoising_strength": 0,
"enable_hr": False,
"eta": 0,
"... | Python | 139,088 |
test_torch_utils.py | AUTOMATIC1111_stable-diffusion-webui/test/test_torch_utils.py | import types
import pytest
import torch
from modules import torch_utils
@pytest.mark.parametrize("wrapped", [True, False])
def test_get_param(wrapped):
mod = torch.nn.Linear(1, 1)
cpu = torch.device("cpu")
mod.to(dtype=torch.float16, device=cpu)
if wrapped:
# more or less how spandrel wraps ... | Python | 139,088 |
test_utils.py | AUTOMATIC1111_stable-diffusion-webui/test/test_utils.py | import pytest
import requests
def test_options_write(base_url):
url_options = f"{base_url}/sdapi/v1/options"
response = requests.get(url_options)
assert response.status_code == 200
pre_value = response.json()["send_seed"]
assert requests.post(url_options, json={'send_seed': (not pre_value)}).sta... | Python | 139,088 |
test_face_restorers.py | AUTOMATIC1111_stable-diffusion-webui/test/test_face_restorers.py | import os
from test.conftest import test_files_path, test_outputs_path
import numpy as np
import pytest
from PIL import Image
@pytest.mark.usefixtures("initialize")
@pytest.mark.parametrize("restorer_name", ["gfpgan", "codeformer"])
def test_face_restorers(restorer_name):
from modules import shared
if resto... | Python | 139,088 |
test_extras.py | AUTOMATIC1111_stable-diffusion-webui/test/test_extras.py | import requests
def test_simple_upscaling_performed(base_url, img2img_basic_image_base64):
payload = {
"resize_mode": 0,
"show_extras_results": True,
"gfpgan_visibility": 0,
"codeformer_visibility": 0,
"codeformer_weight": 0,
"upscaling_resize": 2,
"upscalin... | Python | 139,088 |
shared_gradio_themes.py | AUTOMATIC1111_stable-diffusion-webui/modules/shared_gradio_themes.py | import os
import gradio as gr
from modules import errors, shared
from modules.paths_internal import script_path
# https://huggingface.co/datasets/freddyaboulton/gradio-theme-subdomains/resolve/main/subdomains.json
gradio_hf_hub_themes = [
"gradio/base",
"gradio/glass",
"gradio/monochrome",
... | Python | 139,088 |
sd_samplers_timesteps_impl.py | AUTOMATIC1111_stable-diffusion-webui/modules/sd_samplers_timesteps_impl.py | import torch
import tqdm
import k_diffusion.sampling
import numpy as np
from modules import shared
from modules.models.diffusion.uni_pc import uni_pc
from modules.torch_utils import float64
@torch.no_grad()
def ddim(model, x, timesteps, extra_args=None, callback=None, disable=None, eta=0.0):
alphas_c... | Python | 139,088 |
sd_hijack_xlmr.py | AUTOMATIC1111_stable-diffusion-webui/modules/sd_hijack_xlmr.py | import torch
from modules import sd_hijack_clip, devices
class FrozenXLMREmbedderWithCustomWords(sd_hijack_clip.FrozenCLIPEmbedderWithCustomWords):
def __init__(self, wrapped, hijack):
super().__init__(wrapped, hijack)
self.id_start = wrapped.config.bos_token_id
self.id_end = w... | Python | 139,088 |
sd_vae.py | AUTOMATIC1111_stable-diffusion-webui/modules/sd_vae.py | import os
import collections
from dataclasses import dataclass
from modules import paths, shared, devices, script_callbacks, sd_models, extra_networks, lowvram, sd_hijack, hashes
import glob
from copy import deepcopy
vae_path = os.path.abspath(os.path.join(paths.models_path, "VAE"))
vae_ignore_keys = {"model_ema.de... | Python | 139,088 |
sd_hijack_optimizations.py | AUTOMATIC1111_stable-diffusion-webui/modules/sd_hijack_optimizations.py | from __future__ import annotations
import math
import psutil
import platform
import torch
from torch import einsum
from ldm.util import default
from einops import rearrange
from modules import shared, errors, devices, sub_quadratic_attention
from modules.hypernetworks import hypernetwork
import ldm.mo... | Python | 139,088 |
paths_internal.py | AUTOMATIC1111_stable-diffusion-webui/modules/paths_internal.py | """this module defines internal paths used by program and is safe to import before dependencies are installed in launch.py"""
import argparse
import os
import sys
import shlex
from pathlib import Path
normalized_filepath = lambda filepath: str(Path(filepath).absolute())
commandline_args = os.environ.get(... | Python | 139,088 |
script_callbacks.py | AUTOMATIC1111_stable-diffusion-webui/modules/script_callbacks.py | from __future__ import annotations
import dataclasses
import inspect
import os
from typing import Optional, Any
from fastapi import FastAPI
from gradio import Blocks
from modules import errors, timer, extensions, shared, util
def report_exception(c, job):
errors.report(f"Error executing callback ... | Python | 139,088 |
ui.py | AUTOMATIC1111_stable-diffusion-webui/modules/ui.py | import datetime
import mimetypes
import os
import sys
from functools import reduce
import warnings
from contextlib import ExitStack
import gradio as gr
import gradio.utils
import numpy as np
from PIL import Image, PngImagePlugin # noqa: F401
from modules.call_queue import wrap_gradio_gpu_call, wrap_queued... | Python | 139,088 |
img2img.py | AUTOMATIC1111_stable-diffusion-webui/modules/img2img.py | import os
from contextlib import closing
from pathlib import Path
import numpy as np
from PIL import Image, ImageOps, ImageFilter, ImageEnhance, UnidentifiedImageError
import gradio as gr
from modules import images
from modules.infotext_utils import create_override_settings_dict, parse_generation_parameters
... | Python | 139,088 |
scripts_postprocessing.py | AUTOMATIC1111_stable-diffusion-webui/modules/scripts_postprocessing.py | import dataclasses
import os
import gradio as gr
from modules import errors, shared
@dataclasses.dataclass
class PostprocessedImageSharedInfo:
target_width: int = None
target_height: int = None
class PostprocessedImage:
def __init__(self, image):
self.image = image
self.... | Python | 139,088 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 5