Skip to content

Instantly share code, notes, and snippets.

View koorukuroo's full-sized avatar
🎯
Focusing

Kyunghoon Kim koorukuroo

🎯
Focusing
View GitHub Profile
from moviepy.editor import VideoClip, TextClip
from tqdm import tqdm
def make_frame(t):
# Calculate remaining time in minutes and seconds
remaining_time = max(0, int(5*60 - t))
minutes, seconds = divmod(remaining_time, 60)
time_str = f"{minutes:01d}:{seconds:02d}"
# Create TextClip for the countdown with 4K resolution
import openai
openai.api_key = 'sk-API 키를 입력하세요'
def lambda_handler(event, context):
if 'm' in event['params']['querystring']:
input_message = event['params']['querystring']['m']
else:
input_message = "나는 신한투자증권에 입사하려는 개발자야. 클라우드를 공부해야 할 필요가 있을까?"
import openai
openai.api_key = 'sk-API키를 입력합니다'
def lambda_handler(event, context):
message = openai.ChatCompletion.create(
model="gpt-4o-mini", # 사용 모델
messages=[
from fastapi import FastAPI
import redis
app = FastAPI()
redis_client = redis.Redis(host='localhost', port=6379, db=0)
@app.get("/items/{id}")
def read_item(id: str):
value = redis_client.get(id)
if value:
from moviepy.editor import TextClip, CompositeVideoClip, ColorClip
from moviepy.editor import VideoFileClip, concatenate_videoclips
from moviepy.video.fx.all import fadein, fadeout
from multiprocessing import Pool
import os
# 시간을 HH:MM:SS 형식으로 변환하는 함수
def format_time(seconds):
hours = seconds // 3600
minutes = (seconds % 3600) // 60
@koorukuroo
koorukuroo / 1min.py
Created September 4, 2024 12:09
generate 1min countdown video
from moviepy.editor import TextClip, CompositeVideoClip, ColorClip
from moviepy.video.fx.all import fadein, fadeout
# 60초 카운트다운 비디오 생성 (메모리 최적화)
def create_stylish_countdown_video(duration=60):
# 비디오 파일의 파트들을 저장할 리스트
filenames = []
for i in range(duration, 0, -1):
# 배경 클립 생성 (파란색 배경)
@koorukuroo
koorukuroo / cuda_11.8_installation_on_Ubuntu_22.04
Created January 22, 2024 10:14 — forked from MihailCosmin/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
from diffusers import LCMScheduler
from diffusers import AutoPipelineForText2Image
import torch
from dotenv import load_dotenv
import os
from openai import OpenAI
import gradio as gr
import random
import time
import string
import json
from broadcaster import Broadcast
from starlette.applications import Starlette
from starlette.concurrency import run_until_first_complete
from starlette.routing import Route, WebSocketRoute
from starlette.templating import Jinja2Templates
from starlette.middleware import Middleware
from starlette.middleware.cors import CORSMiddleware
from dotenv import load_dotenv
import os
@koorukuroo
koorukuroo / chatgpt-stable-diffusion-generate-prompt
Created May 28, 2023 04:01 — forked from anonymousmaharaj/chatgpt-stable-diffusion-generate-prompt
Prompt for ChatGPT to generate correct prompts to SD. You can leave comment to improve it.
I want you to help me make requests (prompts) for the Stable Diffusion neural network.
Stable diffusion is a text-based image generation model that can create diverse and high-quality images based on your requests. In order to get the best results from Stable diffusion, you need to follow some guidelines when composing prompts.
Here are some tips for writing prompts for Stable diffusion1:
1) Be as specific as possible in your requests. Stable diffusion handles concrete prompts better than abstract or ambiguous ones. For example, instead of “portrait of a woman” it is better to write “portrait of a woman with brown eyes and red hair in Renaissance style”.
2) Specify specific art styles or materials. If you want to get an image in a certain style or with a certain texture, then specify this in your request. For example, instead of “landscape” it is better to write “watercolor landscape with mountains and lake".
3) Specify specific artists for reference. If you want to get an image similar to the work of some